wsp::Layer Class Reference

Drawable objects should derive from this class. Layers can be managed by LayerManagers. More...

#include <layer.h>

Inheritance diagram for wsp::Layer:

wsp::Quad wsp::Sprite wsp::TiledLayer

List of all members.

Public Member Functions

u32 GetHeight () const
u32 GetWidth () const
f32 GetX () const
f32 GetY () const
bool IsVisible () const
void SetVisible (bool visible)
void SetPosition (f32 x, f32 y)
void Move (f32 deltaX, f32 deltaY)
void SetX (f32 x)
void SetX (s32 x)
void SetX (u32 x)
void SetY (f32 y)
void SetY (s32 y)
void SetY (u32 y)
virtual void Draw (f32 offsetX=0, f32 offsetY=0) const

Protected Attributes

u32 _height
 Height of the Layer.
u32 _width
 Width of the Layer.


Detailed Description

Drawable objects should derive from this class. Layers can be managed by LayerManagers.

Member Function Documentation

u32 wsp::Layer::GetHeight (  )  const

Gets the height of the layer.

Returns:
the current height of this layer.

u32 wsp::Layer::GetWidth (  )  const

Gets the width of the layer.

Returns:
the current width of this layer.

f32 wsp::Layer::GetX (  )  const

Gets the X position on the viewport.

Returns:
The X position.

f32 wsp::Layer::GetY (  )  const

Gets the Y position on the viewport.

Returns:
The Y position.

bool wsp::Layer::IsVisible (  )  const

Checks if the layer is visible. Is visible by default.

Returns:
true if it is visible, false if not.

void wsp::Layer::SetVisible ( bool  visible  ) 

Changes the visibility of the layer.

Parameters:
visible true for show, false for hide.

void wsp::Layer::SetPosition ( f32  x,
f32  y 
)

Changes the absolute position of the layer on the viewport.

Parameters:
x The new X position.
y The new Y position.

void wsp::Layer::Move ( f32  deltaX,
f32  deltaY 
)

Moves the layer some units.

Parameters:
deltaX Moves the layer a specific amount of units to the left/right.
deltaY Moves the layer a specific amount of units up/down.

void wsp::Layer::SetX ( f32  x  ) 

Sets the X position on the viewport.

Parameters:
x The new X position of this layer.

void wsp::Layer::SetX ( s32  x  ) 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
x The new X position of this layer.

void wsp::Layer::SetX ( u32  x  ) 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
x The new X position of this layer.

void wsp::Layer::SetY ( f32  y  ) 

Sets the Y position on the viewport.

Parameters:
y The new Y position of this layer.

void wsp::Layer::SetY ( s32  y  ) 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
y The new Y position of this layer.

void wsp::Layer::SetY ( u32  y  ) 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
y The new Y position of this layer.

virtual void wsp::Layer::Draw ( f32  offsetX = 0,
f32  offsetY = 0 
) const [virtual]

Overloadable method. Here should drawing code be.

Parameters:
offsetX Additional offset for the X position where to draw the layer.
offsetY Additional offset for the Y position where to draw the layer.

Reimplemented in wsp::Quad, wsp::Sprite, and wsp::TiledLayer.


The documentation for this class was generated from the following file:

Generated on Sun Jun 29 14:29:26 2008 for libwiisprite by  doxygen 1.5.5