ActorRenderer class
#include <Jazz2/Actors/ActorBase.h>
Actor renderer.
Base classes
- class nCine::BaseSprite
- Base class for textured sprites.
Constructors, destructors, conversion operators
- ActorRenderer(ActorBase* owner)
- Creates a new instance.
Public functions
- void Initialize(ActorRendererType type)
- Initializes the renderer to the specified renderer type.
-
void SetPalette(std::
int32_t paletteOffset) - Selects a recolor palette override.
-
void SetIndexed(bool indexed,
std::
int32_t basePaletteOffset) - Marks whether the current graphic is indexed and which palette region it samples.
- void OnUpdate(float timeMult) override
- Called every frame to update the node state.
- auto OnDraw(RenderQueue& renderQueue) -> bool override
- Called when the node needs to be drawn, returning
trueif a command was added. - auto IsAnimationRunning() -> bool
- Returns
trueif animation is running. - auto GetRendererType() const -> ActorRendererType
- Returns active renderer type.
- void UpdateAnchor()
- Points the sprite's anchor at the hotspot of the frame being shown.
Public variables
-
const Resources::
GenericGraphicResource* FrameSource - Sheet the frames come from, or
nullptrwhen the frames form a regular grid. - Vector2i FrameConfiguration
- Frame configuration.
- Vector2i FrameDimensions
- Frame dimensions.
- Vector2f Hotspot
- Hotspot of the current animation, never mirrored.
- AnimationLoopMode LoopMode
- Animation loop mode.
-
std::
int32_t FirstFrame - Frame offset.
-
std::
int32_t FrameCount - Frame count.
- float AnimDuration
- Animation duration (in normalized frames).
- float AnimTime
- Current animation progress.
-
std::
int32_t CurrentFrame - Current animation frame.
- bool AnimPaused
- Whether the animation is paused.
Protected functions
- void TextureHasChanged(Texture* newTexture) override
- Performs the required tasks upon a change to the texture.
Function documentation
Jazz2:: Actors:: ActorBase:: ActorRenderer:: ActorRenderer(ActorBase* owner)
Creates a new instance.
| Parameters | |
|---|---|
| owner | Actor that owns this renderer |
void Jazz2:: Actors:: ActorBase:: ActorRenderer:: SetPalette(std:: int32_t paletteOffset)
Selects a recolor palette override.
Flat offset into the shared palette texture, or -1 for none. Takes precedence over SetIndexed.
void Jazz2:: Actors:: ActorBase:: ActorRenderer:: SetIndexed(bool indexed,
std:: int32_t basePaletteOffset)
Marks whether the current graphic is indexed and which palette region it samples.
Set automatically by ActorBase::RefreshAnimation, a SetPalette override wins.
void Jazz2:: Actors:: ActorBase:: ActorRenderer:: UpdateAnchor()
Points the sprite's anchor at the hotspot of the frame being shown.
A flipped hotspot is mirrored within the frame's own area, not the animation's cell.