|
| AnimatedSpriteRenderComponent (Actor *pOwner, int pDrawOrder=100) |
| Constructs an animated sprite component with an optional draw order.
|
|
virtual | ~AnimatedSpriteRenderComponent () |
| Destructor for the animated sprite component.
|
|
| AnimatedSpriteRenderComponent ()=delete |
|
| AnimatedSpriteRenderComponent (const AnimatedSpriteRenderComponent &)=delete |
|
AnimatedSpriteRenderComponent & | operator= (const AnimatedSpriteRenderComponent &)=delete |
|
void | SetAnimationFps (float pFps) |
| Sets the frame rate (FPS) for the animation.
|
|
void | SetCurrentAnimation (std::string pAnimation) |
| Changes the current animation to play, by name. If the animation is not found, it has no effect.
|
|
void | AddAnimation (std::string pName, std::vector< Texture * > pTextures) |
| Adds a new animation consisting of a name and a sequence of textures.
|
|
void | Update () override |
| Updates the animation by progressing the current frame based on time.
|
|
float | GetAnimationFps () const |
| Gets the currently configured animation FPS.
|
|
| SpriteRenderComponent (Actor *pOwner, int pDrawOrder=100) |
| Constructs a sprite render component without a texture.
|
|
| SpriteRenderComponent (Actor *pOwner, Texture *pTexture, int pDrawOrder=100) |
| Constructs a sprite render component with an initial texture.
|
|
| SpriteRenderComponent ()=delete |
|
| SpriteRenderComponent (const SpriteRenderComponent &)=delete |
|
SpriteRenderComponent & | operator= (const SpriteRenderComponent &)=delete |
|
virtual void | SetTexture (Texture *pTexture) |
| Sets or updates the texture used by this sprite. Also updates internal texture dimensions.
|
|
virtual void | Render (IRenderer *pRenderer) override |
| Renders the sprite using the provided renderer. Applies flip settings and position based on the rectangle.
|
|
RenderType | GetRenderType () override |
| Returns the render type of this component (Viewport).
|
|
void | SetNewDimensions (float x, float y) |
| Sets new dimensions (width and height) for the sprite's rectangle.
|
|
void | SetNewPositions (float x, float y) |
| Sets a new position (x, y) for the sprite's rectangle.
|
|
int | GetDrawOrder () const override |
| Gets the drawing order priority of this component. Higher values render on top of lower values.
|
|
int | GetTexWidth () const |
| Gets the width of the texture used by this sprite.
|
|
int | GetTexHeight () const |
| Gets the height of the texture used by this sprite.
|
|
| RenderComponent (Actor *pOwner) |
| Constructs the RenderComponent and assigns it to the owning Actor.
|
|
void | OnStart () override |
| Called when the component is started. Registers the component with the scene's renderer for drawing.
|
|
void | OnEnd () override |
| Called when the component is removed or destroyed. Unregisters the component from the renderer.
|
|
| Component (Actor *pOwner, int pUpdateOrder=100) |
| Constructor for Component.
|
|
virtual | ~Component () |
|
virtual void | OnUpdateWorldTrandform () |
| Called when the world transform of the actor is updated. This allows the component to react to changes in the actor's world transform.
|
|
void | SetActive (bool isActive) |
| Sets the active status of the component.
|
|
void | SetOwner (Actor *pOwner) |
| Sets the actor that owns this component.
|
|
int | GetUpdateOrder () const |
| Returns the update order of the component. Components with lower update orders are updated first.
|
|
Actor * | GetOwner () const |
| Returns the actor that owns this component.
|
|
|
Rectangle | mRectangle { Vector2(-16,-16),Vector2(32,32) } |
| The rectangle defining sprite position and size, relative to the actor.
|
|
IRenderer::Flip | mFlip = IRenderer::Flip::None |
| Flip mode (none, horizontal, vertical, both) for sprite rendering.
|
|
Color | mColor { 255,255,255,255 } |
|
Texture * | mTexture |
| The texture used for rendering this sprite.
|
|
int | mDrawOrder |
| Drawing order priority.
|
|
int | mTexWidth |
| Internal texture width (updated with SetTexture).
|
|
int | mTexHeight |
| Internal texture height (updated with SetTexture).
|
|
Actor * | mOwner = nullptr |
| The actor that owns this component.
|
|
AnimatedSpriteRenderComponent extends SpriteRenderComponent to support frame-based 2D sprite animations using a sequence of textures.