C# Class geek.GameEngine.Visuals.GameObject

The class that describes all active objects in the game that move, animate and interact with the user.
Inheritance: InteractableObject
Afficher le fichier Open project: impworks/xna.geek.engine Class Usage Examples

Méthodes publiques

Свойство Type Description
CollisionDetectionMode CollisionDetectionMode
IsBlendingEnabled bool

Méthodes publiques

Méthode Description
AddAnimation ( string assetName, int frameCount, float frameRate, bool looped = true ) : AnimatedSprite

Create a new animation for the object.

AddAnimation ( string assetName ) : Sprite

Creates a new static animation frame for the object.

Draw ( SpriteBatch batch ) : void

Draws the current animation frame to screen.

GameObject ( ) : System
GameObject ( Vector2 position ) : System
GameObject ( float x, float y ) : System
GetBoundingBox ( bool absolute = false ) : Rectangle

Returns the bounding box for the object. The current sprite is used. The bounding box does not take transparency into account.

GetCurrentAnimation ( ) : SpriteBase

Returns the current animation that is played.

IsOverlappedWith ( InteractableObject obj ) : bool

Smart collision detection allowing for pixel-perfect collisions.

SetAnimation ( SpriteBase sprite ) : void

Set the current animation and play it.

SetAnimation ( int id, bool restart = false ) : void

Set the current animation and play it.

Update ( ) : void

Update the current animation.

Method Details

AddAnimation() public méthode

Create a new animation for the object.
public AddAnimation ( string assetName, int frameCount, float frameRate, bool looped = true ) : AnimatedSprite
assetName string Asset name to use as texture.
frameCount int Number of frames in the animation.
frameRate float Frame rate.
looped bool Loop animation flag.
Résultat geek.GameEngine.Sprites.AnimatedSprite

AddAnimation() public méthode

Creates a new static animation frame for the object.
public AddAnimation ( string assetName ) : Sprite
assetName string Asset name to use.
Résultat Sprite

Draw() public méthode

Draws the current animation frame to screen.
public Draw ( SpriteBatch batch ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Sprite batch
Résultat void

GameObject() public méthode

public GameObject ( ) : System
Résultat System

GameObject() public méthode

public GameObject ( Vector2 position ) : System
position Vector2
Résultat System

GameObject() public méthode

public GameObject ( float x, float y ) : System
x float
y float
Résultat System

GetBoundingBox() public méthode

Returns the bounding box for the object. The current sprite is used. The bounding box does not take transparency into account.
public GetBoundingBox ( bool absolute = false ) : Rectangle
absolute bool
Résultat Microsoft.Xna.Framework.Rectangle

GetCurrentAnimation() public méthode

Returns the current animation that is played.
public GetCurrentAnimation ( ) : SpriteBase
Résultat geek.GameEngine.Sprites.SpriteBase

IsOverlappedWith() public méthode

Smart collision detection allowing for pixel-perfect collisions.
public IsOverlappedWith ( InteractableObject obj ) : bool
obj InteractableObject Object to test against
Résultat bool

SetAnimation() public méthode

Set the current animation and play it.
public SetAnimation ( SpriteBase sprite ) : void
sprite geek.GameEngine.Sprites.SpriteBase Animation.
Résultat void

SetAnimation() public méthode

Set the current animation and play it.
public SetAnimation ( int id, bool restart = false ) : void
id int Animation id.
restart bool
Résultat void

Update() public méthode

Update the current animation.
public Update ( ) : void
Résultat void

Property Details

CollisionDetectionMode public_oe property

The collision detection mode.
public CollisionDetectionMode CollisionDetectionMode
Résultat CollisionDetectionMode

IsBlendingEnabled public_oe property

Activate blendable animations' blending mode?
public bool IsBlendingEnabled
Résultat bool