C# Class GameGraphics.GraphicsObject

Afficher le fichier Open project: pmyoung/Advanced-Game-Project Class Usage Examples

Méthodes publiques

Méthode 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 méthode

Returns the given angle of the object
public GetAngle ( ) : float
Résultat float

GetColor() public méthode

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

GetColorID() public méthode

Returns the given color ID of the object
public GetColorID ( ) : int
Résultat int

GetID() public méthode

Returns the objects unique ID.
public GetID ( ) : int
Résultat int

GetRadius() public méthode

Returns the given radius of the object
public GetRadius ( ) : float
Résultat float

GetSpriteID() public méthode

Returns the given sprite ID of the object
public GetSpriteID ( ) : int
Résultat int

GetX() public méthode

Returns the given X location
public GetX ( ) : float
Résultat float

GetY() public méthode

Returns the given Y location
public GetY ( ) : float
Résultat float

GraphicsObject() public méthode

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
Résultat System

GraphicsObject() public méthode

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
Résultat System

GraphicsObject() public méthode

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)
Résultat System

SetAngle() public méthode

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

SetColor() public méthode

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

SetColor() public méthode

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
Résultat void

SetColorID() public méthode

public SetColorID ( int colorID ) : void
colorID int
Résultat void

SetID() public méthode

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

SetRadius() public méthode

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

SetSpriteID() public méthode

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
Résultat void

SetX() public méthode

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

SetY() public méthode

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