Class BufferedSprite
Represents a game element that creates a buffered sprite with vertices, colors, and texture coordinates.
Inherited Members
Namespace: Genesis.Core.GameElements
Assembly: Genesis.dll
Syntax
public class BufferedSprite : GameElement
Constructors
BufferedSprite(string, Vec3, Texture)
Creates a new buffered sprite with the specified name, location, and texture.
Declaration
public BufferedSprite(string name, Vec3 location, Texture texture)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the game element. |
Vec3 | location | The location of the game element. |
Texture | texture | The texture applied to the sprite. |
Properties
Colors
Gets or sets the list of colors for the sprite.
Declaration
public List<float> Colors { get; set; }
Property Value
Type | Description |
---|---|
List<float> |
ShapeDeffinitions
Gets or sets the list of shape definitions for the sprite.
Declaration
public List<SpriteShapeDeffinition> ShapeDeffinitions { get; set; }
Property Value
Type | Description |
---|---|
List<SpriteShapeDeffinition> |
TexCoords
Gets or sets the list of texture coordinates for the sprite.
Declaration
public List<float> TexCoords { get; set; }
Property Value
Type | Description |
---|---|
List<float> |
Texture
Gets or sets the texture applied to the sprite.
Declaration
public Texture Texture { get; set; }
Property Value
Type | Description |
---|---|
Texture |
Verticies
Gets or sets the list of vertices for the sprite.
Declaration
public List<float> Verticies { get; set; }
Property Value
Type | Description |
---|---|
List<float> |
Methods
AddShape(Vec3, Vec3)
Adds a new rectangular shape at the given location and with the given size to the sprite.
Declaration
public void AddShape(Vec3 location, Vec3 size)
Parameters
Type | Name | Description |
---|---|---|
Vec3 | location | The location for the sprite. |
Vec3 | size | The size for the sprite. |
AddShape(Vec3, Vec3, TexCoords)
Adds a new rectangular shape at the given location, size, and texture coordinates to the sprite.
Declaration
public void AddShape(Vec3 location, Vec3 size, TexCoords texCoords)
Parameters
Type | Name | Description |
---|---|---|
Vec3 | location | The location for the sprite. |
Vec3 | size | The size for the sprite. |
TexCoords | texCoords | The texture coordinates for the sprite. |
Init(Game, IRenderDevice)
Initializes the game element.
Declaration
public override void Init(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device used for rendering. |
Overrides
OnDestroy(Game)
Clears the GPU memory
Declaration
public override void OnDestroy(Game game)
Parameters
Type | Name | Description |
---|---|---|
Game | game |
Overrides
OnRender(Game, IRenderDevice)
Renders the game element.
Declaration
public override void OnRender(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device used for rendering. |
Overrides
OnUpdate(Game, IRenderDevice)
Updates the game element.
Declaration
public override void OnUpdate(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device used for rendering. |