|
Arcade Shooter
|
Enables a group of sprites to be drawn using the same settings. More...
#include <SpriteBatch.h>
Public Member Functions | |
| void | Begin (const SpriteSortMode sortMode=SpriteSortMode::DEFERRED, const BlendState blendState=BlendState::ALPHA, ALLEGRO_TRANSFORM *pTransformation=NULL) |
| Begins a sprite batch operation. More... | |
| void | End () |
| Flushes the sprite batch and restores the device state to how it was before Begin was called. | |
| void | DrawString (const Font *pFont, std::string *text, const Vector2 position, const Color color=Color::White, const TextAlign alignment=TextAlign::LEFT, const float drawDepth=0) |
| Adds a string to a batch of sprites to be rendered. More... | |
| void | Draw (const Texture *pTexture, const Vector2 position, const Region region, const Color color=Color::White, const Vector2 origin=Vector2::Zero, const Vector2 scale=Vector2::One, const float rotation=0, const float drawDepth=0) |
| Adds a sprite to a batch of sprites to be rendered. More... | |
| void | Draw (const Texture *pTexture, const Vector2 position, const Color color=Color::White, const Vector2 origin=Vector2::Zero, const Vector2 scale=Vector2::One, const float rotation=0, const float drawDepth=0) |
| Adds a sprite to a batch of sprites to be rendered. More... | |
| void | Draw (Animation *pAnimation, const Vector2 position, const Color color=Color::White, const Vector2 origin=Vector2::Zero, const Vector2 scale=Vector2::One, const float rotation=0, float drawDepth=0) |
| Adds a sprite to a batch of sprites to be rendered. More... | |
| void | GetBatchSettings (SpriteSortMode &sortMode, BlendState &blendState, ALLEGRO_TRANSFORM *pTransformation) |
| Gets the current settings from the sprite batch. More... | |
Enables a group of sprites to be drawn using the same settings.
| void KatanaEngine::SpriteBatch::Begin | ( | const SpriteSortMode | sortMode = SpriteSortMode::DEFERRED, |
| const BlendState | blendState = BlendState::ALPHA, |
||
| ALLEGRO_TRANSFORM * | pTransformation = NULL |
||
| ) |
Begins a sprite batch operation.
| sortMode | Defines how to sort the sprites for rendering. |
| blendState | Defines how to blend overlaping sprites. |
| pTransformation | Defines a screen space transformation to use. |
| void KatanaEngine::SpriteBatch::Draw | ( | const Texture * | pTexture, |
| const Vector2 | position, | ||
| const Region | region, | ||
| const Color | color = Color::White, |
||
| const Vector2 | origin = Vector2::Zero, |
||
| const Vector2 | scale = Vector2::One, |
||
| const float | rotation = 0, |
||
| const float | drawDepth = 0 |
||
| ) |
Adds a sprite to a batch of sprites to be rendered.
| pTexture | A pointer to the texture to render. |
| position | The screen position of the sprite. |
| region | The region of the texture to render. |
| color | The color to tint the sprite. The default is Color::White (no tint). |
| origin | The sprite's origin. The default is Vector2::Zero, which is the upper left corner of the sprite. |
| scale | The scale factor of the sprite. The default is Vector2::One. |
| rotation | The rotation angle in radians. The default is zero. |
| drawDepth | The depth at which to render the sprite. This is determined by the SpriteSortMode arguement that is passed to SpriteBatch::Begin(). The default is zero. |
| void KatanaEngine::SpriteBatch::Draw | ( | const Texture * | pTexture, |
| const Vector2 | position, | ||
| const Color | color = Color::White, |
||
| const Vector2 | origin = Vector2::Zero, |
||
| const Vector2 | scale = Vector2::One, |
||
| const float | rotation = 0, |
||
| const float | drawDepth = 0 |
||
| ) |
Adds a sprite to a batch of sprites to be rendered.
| pTexture | A pointer to the texture to render. |
| position | The screen position of the sprite. |
| color | The color to tint the sprite. The default is Color::White (no tint). |
| origin | The sprite's origin. The default is Vector2::Zero, which is the upper left corner of the sprite. |
| scale | The scale factor of the sprite. The default is Vector2::One. |
| rotation | The rotation angle in radians. The default is zero. |
| drawDepth | The depth at which to render the sprite. This is determined by the SpriteSortMode arguement that is passed to SpriteBatch::Begin(). The default is zero. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void KatanaEngine::SpriteBatch::Draw | ( | Animation * | pAnimation, |
| const Vector2 | position, | ||
| const Color | color = Color::White, |
||
| const Vector2 | origin = Vector2::Zero, |
||
| const Vector2 | scale = Vector2::One, |
||
| const float | rotation = 0, |
||
| float | drawDepth = 0 |
||
| ) |
Adds a sprite to a batch of sprites to be rendered.
| pAnimation | A pointer to the animation to render. |
| position | The screen position of the sprite. |
| color | The color to tint the sprite. The default is Color::White (no tint). |
| origin | The sprite's origin. The default is Vector2::Zero, which is the upper left corner of the sprite. |
| scale | The scale factor of the sprite. The default is Vector2::One. |
| rotation | The rotation angle in radians. The default is zero. |
| drawDepth | The depth at which to render the sprite. This is determined by the SpriteSortMode arguement that is passed to SpriteBatch::Begin(). The default is zero. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void KatanaEngine::SpriteBatch::DrawString | ( | const Font * | pFont, |
| std::string * | text, | ||
| const Vector2 | position, | ||
| const Color | color = Color::White, |
||
| const TextAlign | alignment = TextAlign::LEFT, |
||
| const float | drawDepth = 0 |
||
| ) |
Adds a string to a batch of sprites to be rendered.
| pFont | The font used to draw the text. |
| text | The text to display. |
| position | The screen position of the text. |
| color | The color to tint the text. The default is Color::White (no tint). |
| alignment | The prefered method of aligning the text. The default is TextAlign::LEFT. |
| drawDepth | The depth at which to render the sprite. This is determined by the SpriteSortMode arguement that is passed to SpriteBatch::Begin(). The default is zero. |
| void KatanaEngine::SpriteBatch::GetBatchSettings | ( | SpriteSortMode & | sortMode, |
| BlendState & | blendState, | ||
| ALLEGRO_TRANSFORM * | pTransformation | ||
| ) |
Gets the current settings from the sprite batch.
| sortMode | Defines how to sort the sprites for rendering. |
| blendState | Defines how to blend overlaping sprites. |
| pTransformation | Defines a screen space transformation to use. |
1.8.13