![]() |
Paradox Game Engine
v1.0.0 beta06
|
A sprite represents a series frames in an atlas forming an animation. More...
Public Member Functions | |
Sprite () | |
Creates a new instance of sprite with unique random name. More... | |
Sprite (string fragmentName) | |
Create a new instance of sprite. More... | |
void | Draw (SpriteBatch spriteBatch, Vector2 position, float rotation=0, float depthLayer=0, SpriteEffects spriteEffects=SpriteEffects.None) |
Draw a specific frame of the sprite with white color and scale of 1. More... | |
void | Draw (SpriteBatch spriteBatch, Vector2 position, Color color, Vector2 scales, float rotation=0f, float depthLayer=0, SpriteEffects spriteEffects=SpriteEffects.None) |
Draw a specific frame of the sprite. More... | |
Sprite | Clone () |
Clone the current sprite. More... | |
![]() | |
ImageFragment (string fragmentName) | |
Creates an empty image fragment having the provided name. More... | |
ImageFragment (string fragmentName, Texture2D color, Texture2D alpha) | |
Creates a image fragment having the provided color/alpha textures and name. The region size is initialized with the whole size of the texture. More... | |
override string | ToString () |
Public Attributes | |
Vector2 | Center |
The position of the center of the image in pixels. More... | |
Additional Inherited Members | |
![]() | |
string | Name [get, set] |
Gets or sets the name of the image fragment. More... | |
Texture2D | Texture [get, set] |
The texture in which the image is contained More... | |
Texture2D | TextureAlpha [get, set] |
The texture in which the image alpha is contained More... | |
virtual bool | SubstituteAlpha [get] |
Gets a value indicating if the alpha component of the ImageFragment should be taken from the color of the TextureAlpha texture or not. More... | |
virtual RectangleF | Region [get, set] |
The rectangle specifying the region of the texture to use as fragment. More... | |
bool | IsTransparent [get, set] |
Gets or sets the value indicating if the fragment contains transparent regions. More... | |
virtual ImageOrientation | Orientation [get, set] |
Gets or sets the rotation to apply to the texture region when rendering the ImageFragment More... | |
A sprite represents a series frames in an atlas forming an animation.
SiliconStudio.Paradox.Graphics.Sprite.Sprite | ( | ) |
SiliconStudio.Paradox.Graphics.Sprite.Sprite | ( | string | fragmentName | ) |
Sprite SiliconStudio.Paradox.Graphics.Sprite.Clone | ( | ) |
void SiliconStudio.Paradox.Graphics.Sprite.Draw | ( | SpriteBatch | spriteBatch, |
Vector2 | position, | ||
float | rotation = 0 , |
||
float | depthLayer = 0 , |
||
SpriteEffects | spriteEffects = SpriteEffects.None |
||
) |
Draw a specific frame of the sprite with white color and scale of 1.
spriteBatch | The sprite batch used to draw the sprite. |
position | The position to which draw the sprite |
rotation | The rotation to apply on the sprite |
depthLayer | The depth layer to which draw the sprite |
spriteEffects | The sprite effect to apply on the sprite |
This function must be called between the SpriteBatch.Begin(SiliconStudio.Paradox.Graphics.SpriteSortMode,SiliconStudio.Paradox.Graphics.Effect) and SpriteBatch.End() calls of the provided spriteBatch
ArgumentException | The provided frame index is not valid. |
ArgumentOutOfRangeException | The provided spriteBatch is null |
Definition at line 51 of file Sprite.cs.
References SiliconStudio.Core.Mathematics.Vector2.One, and SiliconStudio.Core.Mathematics.Color.White.
void SiliconStudio.Paradox.Graphics.Sprite.Draw | ( | SpriteBatch | spriteBatch, |
Vector2 | position, | ||
Color | color, | ||
Vector2 | scales, | ||
float | rotation = 0f , |
||
float | depthLayer = 0 , |
||
SpriteEffects | spriteEffects = SpriteEffects.None |
||
) |
Draw a specific frame of the sprite.
spriteBatch | The sprite batch used to draw the sprite. |
position | The position to which draw the sprite |
color | The color to use to draw the sprite |
rotation | The rotation to apply on the sprite |
scales | The scale factors to apply on the sprite |
depthLayer | The depth layer to which draw the sprite |
spriteEffects | The sprite effect to apply on the sprite |
This function must be called between the SpriteBatch.Begin(SiliconStudio.Paradox.Graphics.SpriteSortMode,SiliconStudio.Paradox.Graphics.Effect) and SpriteBatch.End() calls of the provided spriteBatch
ArgumentException | The provided frame index is not valid. |
ArgumentOutOfRangeException | The provided spriteBatch is null |
Definition at line 70 of file Sprite.cs.
References SiliconStudio.Paradox.Graphics.Center.
Vector2 SiliconStudio.Paradox.Graphics.Sprite.Center |