sprite#

Inherited by: Hero, eweapon, ffc, itemsprite, lweapon, npc

Base class for (most) script-exposed engine sprites.

Variables#

int

X

int

Y

int

Z

int

FakeZ

int

DrawXOffset

int

DrawYOffset

int

DrawZOffset

int

Rotation

int

Dir

int

Tile

int

ScriptTile

int

Extend

int

TileWidth

int

TileHeight

int

CSet

int

Scale

int

DrawStyle

int

Jump

int

FakeJump

bool

Gravity

int

Flip

int

ScriptFlip

bool

Animation

int

HitWidth

int

HitHeight

int

HitZHeight

int

HitXOffset

int

HitYOffset

int

Falling

int

FallCombo

bool[]

MoveFlags

int

LightRadius

int

LightShape

const bool

SwitchHooked

int

ShadowSprite

int

Drowning

int

DrownCombo

int

ShadowXOffset

int

ShadowYOffset

untyped[]

Misc

Variable descriptions#

int X πŸ”— Source


int Y πŸ”— Source


int Z πŸ”— Source


int FakeZ πŸ”— Source

The position of the sprite on the fake Z axis. This value is treated as a second, separate Z axis.

Sprites are offset upwards by this amount when drawn just like the Z axis and shadows will draw if applicable.

However, the sprite’s hitbox is not moved upwards in the Z Axis. Instead, it is moved upwards on the Y axis, mimicking how Vires and Pols Voice worked in the original Zelda.

This value is affected by FakeJump instead of Jump.


int DrawXOffset πŸ”— Source

The visual offset, in pixels. Defaults to 0.

ffc: currently not supported.


int DrawYOffset πŸ”— Source

The visual offset, in pixels. Defaults to 0.

ffc: currently not supported.


int DrawZOffset πŸ”— Source

The Z offset, in pixels.

ffc: currently not supported.


int Rotation πŸ”— Source

Rotation of the sprite draw, in degrees.

Does nothing if the QR β€˜Old (Faster) Sprite Drawing’ is enabled.

ffc: currently not supported.


int Dir πŸ”— Source

The direction that the sprite is facing. Used by certain weapon types to determine movement, shield deflection and such.

Valid values: Direction (DIR_).


int Tile πŸ”— Source

The currently displaying tile of the sprite’s animation. Set by the engine each frame if Animation is enabled.

ffc: Not used - set ffc::Data to the desired combo instead.


int ScriptTile πŸ”— Source

If >-1, this tile is displayed by the engine, regardless of the normal engine animation. Set back to -1 to restore engine animation. Defaults to -1.

ffc: currently not supported.


int Extend πŸ”— Source

If the sprite should be extended (large). Set to 3 to extend, 0 otherwise.

ffc, Hero: Not used.


int TileWidth πŸ”— Source

The width of the sprite’s graphic, in tiles. Visual only. The upper-left corner is the first tile.

Must set Extend to 3 to use (except for fcc).

Max value is 20.

ffc: max value is 4. Hero: Not used.


int TileHeight πŸ”— Source

The height of the sprite’s graphic, in tiles. Visual only. The upper-left corner is the first tile.

Must set Extend to 3 to use (except for fcc).

Max value is 20.

ffc: max value is 4. Hero: Not used.


int CSet πŸ”— Source

Hero: This changes when the Hero is hurt and flashing. Writing to this does nothing, as the Hero cset is updated by the engine every frame - use Hero->ScriptCSet instead.


int Scale πŸ”— Source

The multiplier for scaling the sprite draw.

Scale values are a multiplier: 1.5 == 50% larger (150%). A scale of 0 and a scale of 1 are identical. Negative values are undefined.

Does nothing if the QR β€˜Old (Faster) Sprite Drawing’ is enabled.

ffc: currently not supported.


int DrawStyle πŸ”— Source

The drawing mode to use.

Valid values: DrawStyle (DS_).


int Jump πŸ”— Source

Upward velocity, in pixels per frame. Affected by gravity each frame, if Gravity is true.


int FakeJump πŸ”— Source

The current velocity on the FakeZ axis. This value is added to FakeZ every frame; and this value is decreased by the gravity value until it is lower than the terminal velocity value.


bool Gravity πŸ”— Source

If gravity affects this sprite in sideview mode. True by default.


int Flip πŸ”— Source

How to flip (or rotate) the sprite.

Valid values: TransformationType (FLIP_ or ROT_).


int ScriptFlip πŸ”— Source

If >-1, this flip value will be used instead of Flip. Set back to -1 to restore normal flip.

Defaults to -1.


bool Animation πŸ”— Source

If the engine should animate the sprite’s graphics. If set to false, scripts must set Tile to update the sprite’s graphics manually. Defaults to true.

ffc: Not used.


int HitWidth πŸ”— Source

The width of the hitbox, in pixels.


int HitHeight πŸ”— Source

The height of the hitbox, in pixels.


int HitZHeight πŸ”— Source

The height of the hitbox in the Z-axis, in pixels.


int HitXOffset πŸ”— Source

The hitbox offset, in pixels.


int HitYOffset πŸ”— Source

The hitbox offset, in pixels.


int Falling πŸ”— Source

The timer indicating how many more frames the sprite will fall. If 0, the sprite is not falling. Max value of 70, which is the value at the start of falling.

Hero: Setting Hero->Action to LA_FALLING also sets this to 70.


int FallCombo πŸ”— Source

The pitfall combo the sprite is falling into, if it is falling.

Hero:

If non-zero, this combo’s attributes will affect things such as if the Hero will warp, and how much damage they will take upon finishing falling.

If 0, the Hero will take 1/4 heart of damage, and not warp.

Setting Hero->Action to LA_FALLING will overwrite this value.

Setting Falling will overwrite this value.


bool[] MoveFlags πŸ”— Source

The movement flags of the sprite. See MoveFlag (MV_) constants.


int LightRadius πŸ”— Source

The size of the light emitted by this sprite, in pixels.


int LightShape πŸ”— Source

The shape of light emitted by this sprite. Uses the LIGHT_ constants.


const bool SwitchHooked πŸ”— Source

If the sprite is currently being switch-hooked.

Note: currently not supported for ffc, Hero.


int ShadowSprite πŸ”— Source

The spritedata ID to use for the sprite’s shadow.


int Drowning πŸ”— Source

The timer indicating how long left the sprite will be drowning. If 0, the sprite is not drowning. Max value of 64, which is the value at the start of drowning.


int DrownCombo πŸ”— Source

The liquid combo the sprite is drowning in, if it is drowning.


int ShadowXOffset πŸ”— Source

Offset for the sprite’s shadow.


int ShadowYOffset πŸ”— Source

Offset for the sprite’s shadow.


untyped[] Misc πŸ”— Source

An array of 32 misc values for scripts to use.

ffc: only 16 values.