Otter  0.9.8.91
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.GridCounter Class Reference

Counter in which the value can be moved in both an X and Y direction. Probably most useful for making menus that are grids which the player can move around in. More...

Inherits Otter.Component.

Public Member Functions

void MoveLeft ()
 Move the index left. More...
 
void MoveRight ()
 Move the index right. More...
 
void MoveUp ()
 Move the index up. More...
 
void MoveDown ()
 Move the index down. More...
 
 GridCounter (int value, int width=1, int height=1, bool wrapX=false, bool wrapY=false)
 Create a new GridCounter. More...
 
- Public Member Functions inherited from Otter.Component
GetEntity< T > ()
 Get the Entity as a specific Type. More...
 
virtual void Added ()
 Called when the Component is added to the Entity. More...
 
virtual void Removed ()
 Called when the Component is removed from the Entity. More...
 
void RemoveSelf ()
 Removes the Component from its parent Entity. More...
 
virtual void UpdateFirst ()
 Called during the UpdateFirst on the parent Entity. More...
 
virtual void Update ()
 Called during the Update on the parent Entity. More...
 
virtual void Render ()
 Called during the Render on the parent Entity. More...
 
virtual void UpdateLast ()
 Called during the UpdateLast on the parent Entity. More...
 
GetComponent< T > ()
 Gets the first Component of type T from this Component's Entity. More...
 
List< T > GetComponents< T > ()
 Gets a list of Components of type T from this Component's Entity. More...
 

Static Public Member Functions

static implicit operator float (GridCounter counter)
 
static implicit operator int (GridCounter counter)
 

Public Attributes

int Width
 The width of the grid. More...
 
int Height
 The height of the grid. More...
 
bool WrapX
 Determines if the GridCounter should wrap horizontally. More...
 
bool WrapY
 Determines if the GridCounter should wrap vertically. More...
 
- Public Attributes inherited from Otter.Component
Entity Entity
 The parent Entity of the Component. More...
 
bool RenderAfterEntity = true
 Determines if the Component should render after the Entity has rendered. More...
 
bool Visible = true
 Determines if the Component will render. More...
 
float Timer = 0
 How long the Component has been alive (added to an Entity and updated.) More...
 

Properties

int Index [get, set]
 The 1d value of the counter on the grid. More...
 
bool Wrap [set]
 Set both WrapX and WrapY. More...
 
int Count [get]
 The total number of grid spaces. More...
 
int X [get, set]
 The X value of the counter. More...
 
int Y [get, set]
 The Y value of the counter. More...
 
- Properties inherited from Otter.Component
int InstanceId [get, set]
 The Component's id for the Entity its attached to. More...
 
Scene Scene [get]
 The Scene that the parent Entity is in. More...
 
Collider Collider [get]
 The first Collider of the parent Entity. More...
 
Graphic Graphic [get]
 The first Graphic of the parent Entity. More...
 
List< GraphicGraphics [get]
 The list of Graphics from the parent Entity. More...
 
List< ColliderColliders [get]
 The list of Colliders from the parent Entity. More...
 

Detailed Description

Counter in which the value can be moved in both an X and Y direction. Probably most useful for making menus that are grids which the player can move around in.

Constructor & Destructor Documentation

Otter.GridCounter.GridCounter ( int  value,
int  width = 1,
int  height = 1,
bool  wrapX = false,
bool  wrapY = false 
)

Create a new GridCounter.

Parameters
valueThe initial value of the GridCounter.
widthThe width of the grid.
heightThe height of the grid.
wrapXDetermines if the counter should wrap horizontally.
wrapYDetermines if the counter should wrap vertically.

Member Function Documentation

void Otter.GridCounter.MoveDown ( )

Move the index down.

void Otter.GridCounter.MoveLeft ( )

Move the index left.

void Otter.GridCounter.MoveRight ( )

Move the index right.

void Otter.GridCounter.MoveUp ( )

Move the index up.

Member Data Documentation

int Otter.GridCounter.Height

The height of the grid.

int Otter.GridCounter.Width

The width of the grid.

bool Otter.GridCounter.WrapX

Determines if the GridCounter should wrap horizontally.

bool Otter.GridCounter.WrapY

Determines if the GridCounter should wrap vertically.

Property Documentation

int Otter.GridCounter.Count
get

The total number of grid spaces.

int Otter.GridCounter.Index
getset

The 1d value of the counter on the grid.

bool Otter.GridCounter.Wrap
set

Set both WrapX and WrapY.

int Otter.GridCounter.X
getset

The X value of the counter.

int Otter.GridCounter.Y
getset

The Y value of the counter.


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