C# Class GameGraphics.GraphicsObject

Mostra file Open project: pmyoung/Advanced-Game-Project Class Usage Examples

Public Methods

Method Description
GetAngle ( ) : float

Returns the given angle of the object

GetColor ( ) : Color

Returns the actual color that this sprite will be using

GetColorID ( ) : int

Returns the given color ID of the object

GetID ( ) : int

Returns the objects unique ID.

GetRadius ( ) : float

Returns the given radius of the object

GetSpriteID ( ) : int

Returns the given sprite ID of the object

GetX ( ) : float

Returns the given X location

GetY ( ) : float

Returns the given Y location

GraphicsObject ( int id, float x, float y, float radius, float angle, int spriteID ) : System

Constructor that accepts all but the colorID as parameters. This is usefull for object that do not need their color pallet changed (all objects other than the players)

GraphicsObject ( int id, float x, float y, float radius, float angle, int spriteID, Color color ) : System

Constructor that creates an object with all parameters defined. This version allows the color to be defined through a color object rather than using a default list of colors based on ID.

GraphicsObject ( int id, float x, float y, float radius, float angle, int spriteID, int colorID ) : System

This constructor creates a GraphicsObject with all its parameters defined with values

SetAngle ( float a ) : void

Sets the angle of the GraphicsObject

SetColor ( Color color ) : void

Sets the color that the GraphicsObject will use.

SetColor ( int colorID ) : void

Sets the color of the GraphicsObject based on a predefined list of ID's. If the ID is not in the range of the colorID's then it will use the default (White)

SetColorID ( int colorID ) : void
SetID ( int id ) : void

Sets the ID of the GraphicsObject

SetRadius ( float r ) : void

Sets the radius of the GraphicsObject

SetSpriteID ( int spriteID ) : void

Sets the spriteID which will determine what sprite will be used for this object

SetX ( float x ) : void

Sets the X location of the GraphicsObject

SetY ( float y ) : void

Sets the Y location of the GraphicsObject

Method Details

GetAngle() public method

Returns the given angle of the object
public GetAngle ( ) : float
return float

GetColor() public method

Returns the actual color that this sprite will be using
public GetColor ( ) : Color
return Color

GetColorID() public method

Returns the given color ID of the object
public GetColorID ( ) : int
return int

GetID() public method

Returns the objects unique ID.
public GetID ( ) : int
return int

GetRadius() public method

Returns the given radius of the object
public GetRadius ( ) : float
return float

GetSpriteID() public method

Returns the given sprite ID of the object
public GetSpriteID ( ) : int
return int

GetX() public method

Returns the given X location
public GetX ( ) : float
return float

GetY() public method

Returns the given Y location
public GetY ( ) : float
return float

GraphicsObject() public method

Constructor that accepts all but the colorID as parameters. This is usefull for object that do not need their color pallet changed (all objects other than the players)
public GraphicsObject ( int id, float x, float y, float radius, float angle, int spriteID ) : System
id int the ID of the object this should be unique
x float the x location of the object
y float the y location of the object
radius float the radius of the object
angle float the angle of the object
spriteID int the ID of the sprite the object uses
return System

GraphicsObject() public method

Constructor that creates an object with all parameters defined. This version allows the color to be defined through a color object rather than using a default list of colors based on ID.
public GraphicsObject ( int id, float x, float y, float radius, float angle, int spriteID, Color color ) : System
id int the ID of the object this should be unique
x float the x location of the object
y float the y location of the object
radius float the radius of the object
angle float the angle of the object
spriteID int the ID of the sprite the object uses
color Color The color object that will be used to change the sprites color
return System

GraphicsObject() public method

This constructor creates a GraphicsObject with all its parameters defined with values
public GraphicsObject ( int id, float x, float y, float radius, float angle, int spriteID, int colorID ) : System
id int the ID of the object this should be unique
x float the x location of the object
y float the y location of the object
radius float the radius of the object
angle float the angle of the object
spriteID int the ID of the sprite the object uses
colorID int the ID of the color it wil have (used for the player sprites)
return System

SetAngle() public method

Sets the angle of the GraphicsObject
public SetAngle ( float a ) : void
a float the angle to be given to the object
return void

SetColor() public method

Sets the color that the GraphicsObject will use.
public SetColor ( Color color ) : void
color Color The color that will be used
return void

SetColor() public method

Sets the color of the GraphicsObject based on a predefined list of ID's. If the ID is not in the range of the colorID's then it will use the default (White)
public SetColor ( int colorID ) : void
colorID int the ID value of the color to be used
return void

SetColorID() public method

public SetColorID ( int colorID ) : void
colorID int
return void

SetID() public method

Sets the ID of the GraphicsObject
public SetID ( int id ) : void
id int the id to be given to the object
return void

SetRadius() public method

Sets the radius of the GraphicsObject
public SetRadius ( float r ) : void
r float the radius to be given to the object
return void

SetSpriteID() public method

Sets the spriteID which will determine what sprite will be used for this object
public SetSpriteID ( int spriteID ) : void
spriteID int the ID of the sprite to be used
return void

SetX() public method

Sets the X location of the GraphicsObject
public SetX ( float x ) : void
x float the X location to be given to the object
return void

SetY() public method

Sets the Y location of the GraphicsObject
public SetY ( float y ) : void
y float the Y location to be given to the object
return void