phoenix::PhExtendedBackground Class Reference

Extended Background. More...

#include <PhExtendedBackground.h>

Inheritance diagram for phoenix::PhExtendedBackground:

phoenix::PhSceneNode

List of all members.

Public Member Functions

 PhExtendedBackground (PhSceneManager *s, PhTexture *t, PhColor c=PhColor(255, 255, 255, 255), float d=-100.0f, bool xt=true, bool yt=true, PhVector2d sp=PhVector2d(0.0f, 0.0f), PhVector2d po=PhVector2d(0.0f, 0.0f), PhVector2d o=PhVector2d(0.0f, 0.0f))
 Constuctor.
void setColor (PhColor c)
 Set color function.
PhColor getColor ()
 Get color function.
void setTexture (PhTexture *t)
 Set texture function.
PhTexturegetTexture ()
 Get texture function.
void setHorizontalTile (bool b)
 Set horizontal tile.
void setVerticalTile (bool b)
 Set vertical tile.
void setPosition (PhVector2d v)
 Set position.
PhVector2d getPosition ()
 Get position.
void setTextureOffset (PhVector2d v)
 Set texture offset.
PhVector2d getTextureOffset ()
 Get texture offset.
void setScrollSpeed (PhVector2d v)
 Set scroll speed.
PhVector2d getScrollSpeed ()
 Get scroll speed.
void onPreRender ()
 Pre-render call.
void onRender ()
 Render call.
void onPostRender ()
 Post-render call.


Detailed Description

Extended Background.

This is the extended background class. This is the most advanced background class included with phoenix. Extended background allow for the most control over the background. It provides the ability to change the texture, color, depth, horizontal tile, vertical tile, scroll speed, relative position, and texture offset of a background.

See also:
phoenix::PhSolidBackground, phoenix::PhBackground

Constructor & Destructor Documentation

phoenix::PhExtendedBackground::PhExtendedBackground ( PhSceneManager s,
PhTexture t,
PhColor  c = PhColor(255, 255, 255, 255),
float  d = -100.0f,
bool  xt = true,
bool  yt = true,
PhVector2d  sp = PhVector2d(0.0f, 0.0f),
PhVector2d  po = PhVector2d(0.0f, 0.0f),
PhVector2d  o = PhVector2d(0.0f, 0.0f) 
)

Constuctor.

Parameters:
s Pointer to the scenemanager.
t Texture to use.
c Color to use. Default white.
d Depth. Default -100.0f.
xt Horizontal tile. Default true.
yt Vertical tile. Default true.
sp Scroll speed. Defualt [0,0].
po Relative position of the bg. Default [0,0].
o Texture offset. Default [0,0].


Member Function Documentation

void phoenix::PhExtendedBackground::setColor ( PhColor  c  ) 

Set color function.

Sets the color used to colorize the texture.

Parameters:
c The new color.
See also:
getColor()

PhColor phoenix::PhExtendedBackground::getColor (  ) 

Get color function.

Get the current color used to colorize the texture.

Returns:
The current color.
See also:
setColor()

void phoenix::PhExtendedBackground::setTexture ( PhTexture t  ) 

Set texture function.

Sets the texture used by this node.

Parameters:
t The new texture.
See also:
getTexture()

PhTexture* phoenix::PhExtendedBackground::getTexture (  ) 

Get texture function.

Gets the current texture used by this node.

Returns:
The current texture.
See also:
setTexture()

void phoenix::PhExtendedBackground::setHorizontalTile ( bool  b  ) 

Set horizontal tile.

Sets whether of not to tile this background horizontally.

Parameters:
b Tile boolean.
See also:
setVerticalTile()

void phoenix::PhExtendedBackground::setVerticalTile ( bool  b  ) 

Set vertical tile.

Sets whether of not to tile this background vertically.

Parameters:
b Tile boolean.
See also:
setVerticalTile()

void phoenix::PhExtendedBackground::setPosition ( PhVector2d  v  ) 

Set position.

Sets the position of this background.

Note:
Position is relative to the top-left corner of the VIEW, it is a relative position, not an absolute one.
Parameters:
v New position.
See also:
getPosition()

PhVector2d phoenix::PhExtendedBackground::getPosition (  ) 

Get position.

Note:
Position is relative to the top-left corner of the VIEW, it is a relative position, not an absolute one.
Returns:
The current position of the background.
See also:
setPosition()

void phoenix::PhExtendedBackground::setTextureOffset ( PhVector2d  v  ) 

Set texture offset.

Sets the texture offset of the background. The texture offset is a normalized value and simply modifies The texture coords of the background. Can be use to achieve effects such as paralax and scrolling backgrounds.

Parameters:
v The new texture offset.
See also:
getTextureOffset()

PhVector2d phoenix::PhExtendedBackground::getTextureOffset (  ) 

Get texture offset.

Returns:
The texture offset.
See also:
setTextureOffset()

void phoenix::PhExtendedBackground::setScrollSpeed ( PhVector2d  v  ) 

Set scroll speed.

Using scroll speed the background will automatically change its texture offset every frame, creating the illusion of moving backgrounds.

Parameters:
v The new speed;
See also:
setTextureOffset(), getScrollSpeed()

PhVector2d phoenix::PhExtendedBackground::getScrollSpeed (  ) 

Get scroll speed.

Returns:
The current scroll speed.
See also:
setTextureOffset(), setScrollSpeed()

void phoenix::PhExtendedBackground::onPreRender (  )  [virtual]

Pre-render call.

All nodes in the list will have this function called by the scenemanger once per frame. Overloading this is required. If the scene node wants to be drawn it must call phoenix::PhSceneManger::registerForRendering().

Reimplemented from phoenix::PhSceneNode.

void phoenix::PhExtendedBackground::onRender (  )  [virtual]

Render call.

Any nodes that called phoenix::PhSceneManger::registerForRendering() will first be sorted according to their depth, then this function is called for each node in order. It is highly suggested that you put any drawing code in this function. Of course, it's possible to draw during any of the three node passes, but this pass is the only one that is exclusive (Nodes must register) and is the only one that is depth sorted.

Reimplemented from phoenix::PhSceneNode.

void phoenix::PhExtendedBackground::onPostRender (  )  [virtual]

Post-render call.

The third render pass takes place at the end of every frame, the scene manager calls this function for every node in the list, and any code that should happen after everything is drawn should go here.

Reimplemented from phoenix::PhSceneNode.


The documentation for this class was generated from the following file:
Generated on Tue Nov 20 21:59:24 2007 for Phoenix by  doxygen 1.5.4