Crazy Eddie's GUI System  0.8.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::CoordConverter Class Reference

Utility class that helps in converting various types of co-ordinate between absolute screen positions and positions offset from the top-left corner of a given Window object. More...

Static Public Member Functions

static float alignToPixels (float x)
 Static method used to return a float value rounded to the nearest integer. More...
 
static float asAbsolute (const UDim &u, float base, bool pixelAlign=true)
 converts given UDim to absolute value
 
static float asRelative (const UDim &u, float base)
 converts given UDim to relative value
 
static Vector2f asAbsolute (const Vector2< UDim > &v, const Sizef &base, bool pixelAlign=true)
 converts given Vector2<UDim> to absolute Vector2f
 
static Vector2f asRelative (const Vector2< UDim > &v, const Sizef &base)
 converts given Vector2<UDim> to relative Vector2f
 
static Sizef asAbsolute (const Size< UDim > &v, const Sizef &base, bool pixelAlign=true)
 converts given Size<UDim> to absolute Sizef
 
static Sizef asRelative (const Size< UDim > &v, const Sizef &base)
 converts given Size<UDim> to relative Sizef
 
static Rectf asAbsolute (const URect &r, const Sizef &base, bool pixelAlign=true)
 
static Rectf asRelative (const URect &r, const Sizef &base)
 
static float screenToWindowX (const Window &window, const UDim &x)
 Convert a screen relative UDim co-ordinate value to a window co-ordinate value, specified in pixels. More...
 
static float screenToWindowX (const Window &window, const float x)
 Convert a screen pixel co-ordinate value to a window co-ordinate value, specified in pixels. More...
 
static float screenToWindowY (const Window &window, const UDim &y)
 Convert a screen relative UDim co-ordinate value to a window co-ordinate value, specified in pixels. More...
 
static float screenToWindowY (const Window &window, const float y)
 Convert a screen pixel co-ordinate value to a window co-ordinate value, specified in pixels. More...
 
static Vector2f screenToWindow (const Window &window, const UVector2 &vec)
 Convert a screen relative UVector2 point to a window co-ordinate point, specified in pixels. More...
 
static Vector2f screenToWindow (const Window &window, const Vector2f &vec)
 Convert a screen Vector2 pixel point to a window co-ordinate point, specified in pixels. More...
 
static Rectf screenToWindow (const Window &window, const URect &rect)
 Convert a URect screen area to a window area, specified in pixels. More...
 
static Rectf screenToWindow (const Window &window, const Rectf &rect)
 Convert a Rect screen pixel area to a window area, specified in pixels. More...
 

Detailed Description

Utility class that helps in converting various types of co-ordinate between absolute screen positions and positions offset from the top-left corner of a given Window object.

Member Function Documentation

static float CEGUI::CoordConverter::alignToPixels ( float  x)
inlinestatic

Static method used to return a float value rounded to the nearest integer.

This method is used throughout the library to ensure that elements are
kept at integer pixel positions on the display if user wishes so.
Parameters
xExpression to be rounded to nearest whole number
Returns
x after having been rounded
See Also
Node::setPixelAligned
static Vector2f CEGUI::CoordConverter::screenToWindow ( const Window window,
const UVector2 vec 
)
static

Convert a screen relative UVector2 point to a window co-ordinate point, specified in pixels.

Parameters
windowWindow object to use as a target for the conversion.
vecUVector2 object describing the point to be converted
Returns
Vector2 object describing a window co-ordinate point that is equivalent to screen based UVector2 point vec.
static Vector2f CEGUI::CoordConverter::screenToWindow ( const Window window,
const Vector2f vec 
)
static

Convert a screen Vector2 pixel point to a window co-ordinate point, specified in pixels.

Parameters
windowWindow object to use as a target for the conversion.
vecVector2 object describing the point to be converted.
Returns
Vector2 object describing a window co-ordinate point that is equivalent to screen based Vector2 point vec.
static Rectf CEGUI::CoordConverter::screenToWindow ( const Window window,
const URect rect 
)
static

Convert a URect screen area to a window area, specified in pixels.

Parameters
windowWindow object to use as a target for the conversion.
rectURect object describing the area to be converted
Returns
Rect object describing a window area that is equivalent to URect screen area rect.
static Rectf CEGUI::CoordConverter::screenToWindow ( const Window window,
const Rectf rect 
)
static

Convert a Rect screen pixel area to a window area, specified in pixels.

Parameters
windowWindow object to use as a target for the conversion.
rectRect object describing the area to be converted.
Returns
Rect object describing a window area that is equivalent to Rect screen area rect.
static float CEGUI::CoordConverter::screenToWindowX ( const Window window,
const UDim x 
)
static

Convert a screen relative UDim co-ordinate value to a window co-ordinate value, specified in pixels.

Parameters
windowWindow object to use as a target for the conversion.
xUDim x co-ordinate value to be converted
Returns
float value describing a window co-ordinate value that is equivalent to screen UDim co-ordinate x.
static float CEGUI::CoordConverter::screenToWindowX ( const Window window,
const float  x 
)
static

Convert a screen pixel co-ordinate value to a window co-ordinate value, specified in pixels.

Parameters
windowWindow object to use as a target for the conversion.
xfloat x co-ordinate value to be converted.
Returns
float value describing a window co-ordinate value that is equivalent to screen co-ordinate x.
static float CEGUI::CoordConverter::screenToWindowY ( const Window window,
const UDim y 
)
static

Convert a screen relative UDim co-ordinate value to a window co-ordinate value, specified in pixels.

Parameters
windowWindow object to use as a target for the conversion.
yUDim y co-ordinate value to be converted
Returns
float value describing a window co-ordinate value that is equivalent to screen UDim co-ordinate y.
static float CEGUI::CoordConverter::screenToWindowY ( const Window window,
const float  y 
)
static

Convert a screen pixel co-ordinate value to a window co-ordinate value, specified in pixels.

Parameters
windowWindow object to use as a target for the conversion.
yUDim y co-ordinate value to be converted.
Returns
float value describing a window co-ordinate value that is equivalent to screen co-ordinate y.