![]() |
Angel
A 2D Game Prototyping Engine
|
An Actor to draw lines at regular intervals. More...
#include <GridActor.h>
Inheritance diagram for GridActor:Public Member Functions | |
| GridActor () | |
| GridActor (const Color &lines, const Color &axis, float interval, const Vector2 &minCoord, const Vector2 &maxCoord) | |
| void | SetLineColor (const Color &lineCol) |
| const Color & | GetLineColor () const |
| void | SetAxisColor (const Color &axisCol) |
| const Color & | GetAxisColor () const |
| void | SetInterval (float interval) |
| const float | GetInterval () const |
| void | SetMinCoord (const Vector2 &minCoord) |
| const Vector2 | GetMinCoord () const |
| void | SetMaxCoord (const Vector2 &maxCoord) |
| const Vector2 | GetMaxCoord () const |
| virtual void | Render () |
| virtual void | Update (float dt) |
A GridActor just makes it easy to draw grids in your game. This can be useful for placing objects while you're creating the world, or to just look cool. :-)
Definition at line 41 of file GridActor.h.
| GridActor::GridActor | ( | ) |
The default constructor creates the "Angel grid." An interval of 1.0 GL units, drawing from (-100, -100) to (100, 100), with light blue lines and red axis lines.
Definition at line 35 of file GridActor.cpp.
| GridActor::GridActor | ( | const Color & | lines, |
| const Color & | axis, | ||
| float | interval, | ||
| const Vector2 & | minCoord, | ||
| const Vector2 & | maxCoord | ||
| ) |
If you have something else in mind for your grid, you can specify its visual appearance with this constructor.
| lines | the color of the lines in the grid |
| axis | the color of the lines drawn at the X and Y axes |
| interval | the amount of space (in GL units) between each line |
| minCoord | the bottom-left coordinate from which to start drawing |
| maxCoord | the top-right coordinate at which to stop drawing |
Definition at line 47 of file GridActor.cpp.
| void GridActor::SetLineColor | ( | const Color & | lineCol | ) |
Set the color of the non-axis lines of the grid.
| lineCol | the color of the lines |
Definition at line 58 of file GridActor.cpp.
| const Color & GridActor::GetLineColor | ( | ) | const |
Return the current line color of this GridActor.
Definition at line 63 of file GridActor.cpp.
| void GridActor::SetAxisColor | ( | const Color & | axisCol | ) |
Set the color of the axis lines of the grid.
| axisCol | the color of the axis lines |
Definition at line 68 of file GridActor.cpp.
| const Color & GridActor::GetAxisColor | ( | ) | const |
Return the current axis line color of this GridActor.
Definition at line 73 of file GridActor.cpp.
| void GridActor::SetInterval | ( | float | interval | ) |
Set the spacing of the lines.
| interval | the amount of space between each line in GL units |
Definition at line 78 of file GridActor.cpp.
| const float GridActor::GetInterval | ( | ) | const |
Return the line spacing interval for this GridActor.
Definition at line 83 of file GridActor.cpp.
| void GridActor::SetMinCoord | ( | const Vector2 & | minCoord | ) |
Set the bottom-left coordinate at which to start drawing the grid.
| minCoord | the bottom-left X and Y position in GL units |
Definition at line 88 of file GridActor.cpp.
| const Vector2 GridActor::GetMinCoord | ( | ) | const |
Return the bottom-left start coordinate of the grid.
Definition at line 94 of file GridActor.cpp.
| void GridActor::SetMaxCoord | ( | const Vector2 & | maxCoord | ) |
Set the top-right coordinate at which to stop drawing the grid.
| maxCoord | the top-right X and Y position in GL units |
Definition at line 99 of file GridActor.cpp.
| const Vector2 GridActor::GetMaxCoord | ( | ) | const |
Return the top-right coordinate of the grid.
Definition at line 105 of file GridActor.cpp.
| void GridActor::Render | ( | ) | [virtual] |
Override of the normal Renderable::Render function. Draws the lines that have been specified.
Reimplemented from Renderable.
Definition at line 140 of file GridActor.cpp.
| virtual void GridActor::Update | ( | float | dt | ) | [inline, virtual] |
Override of the normal Renderable::Update function. Does nothing, here to satisfy the abstract base class.
Reimplemented from Renderable.
Definition at line 143 of file GridActor.h.


1.7.5.1