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.
Public variables
- bool AnimPaused
- Whether the animation is paused.
- Vector2i FrameConfiguration
- Frame configuration.
- Vector2i FrameDimensions
- Frame dimensions.
- 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.
- Vector2f Hotspot
- Hotspot.
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.
The override is a flat offset into the shared palette texture (e.g. paletteRow * @ref ContentResolver::ColorsPerPalette), or -1 for no override. It takes precedence over the base palette used for plain (non-recolored) indexed sprites; see 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.
basePaletteOffset is the animation's palette offset (0 = default sprite palette, the gem-gradient rows for gems). Indexed sprites render through the palette shader unless a recolor override is set via SetPalette. Set automatically from the current animation by ActorBase::RefreshAnimation.