C# Класс geek.GameEngine.Visuals.GameObject

The class that describes all active objects in the game that move, animate and interact with the user.
Наследование: InteractableObject
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
CollisionDetectionMode CollisionDetectionMode
IsBlendingEnabled bool

Открытые методы

Метод Описание
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.

Описание методов

AddAnimation() публичный Метод

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.
Результат geek.GameEngine.Sprites.AnimatedSprite

AddAnimation() публичный Метод

Creates a new static animation frame for the object.
public AddAnimation ( string assetName ) : Sprite
assetName string Asset name to use.
Результат Sprite

Draw() публичный Метод

Draws the current animation frame to screen.
public Draw ( SpriteBatch batch ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Sprite batch
Результат void

GameObject() публичный Метод

public GameObject ( ) : System
Результат System

GameObject() публичный Метод

public GameObject ( Vector2 position ) : System
position Vector2
Результат System

GameObject() публичный Метод

public GameObject ( float x, float y ) : System
x float
y float
Результат System

GetBoundingBox() публичный Метод

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
Результат Microsoft.Xna.Framework.Rectangle

GetCurrentAnimation() публичный Метод

Returns the current animation that is played.
public GetCurrentAnimation ( ) : SpriteBase
Результат geek.GameEngine.Sprites.SpriteBase

IsOverlappedWith() публичный Метод

Smart collision detection allowing for pixel-perfect collisions.
public IsOverlappedWith ( InteractableObject obj ) : bool
obj InteractableObject Object to test against
Результат bool

SetAnimation() публичный Метод

Set the current animation and play it.
public SetAnimation ( SpriteBase sprite ) : void
sprite geek.GameEngine.Sprites.SpriteBase Animation.
Результат void

SetAnimation() публичный Метод

Set the current animation and play it.
public SetAnimation ( int id, bool restart = false ) : void
id int Animation id.
restart bool
Результат void

Update() публичный Метод

Update the current animation.
public Update ( ) : void
Результат void

Описание свойств

CollisionDetectionMode публичное свойство

The collision detection mode.
public CollisionDetectionMode CollisionDetectionMode
Результат CollisionDetectionMode

IsBlendingEnabled публичное свойство

Activate blendable animations' blending mode?
public bool IsBlendingEnabled
Результат bool