sprite#

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

Added in version 3.0: In older versions, most of these are implemented as separate variables on many other classes

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

Variables#

Functions#

void

Own(bitmap b)

void

Own(paldata b)

void

Own(file b)

void

Own(directory b)

void

Own(stack b)

void

Own(randgen b)

void

OwnArray(untyped array)

void

OwnObject(untyped object)

Enumerations#

enum ExtendMode: ๐Ÿ”— Source

Sprite rendering extend modes. Used with sprite::Extend.

ExtendMode EXT_NONE = 0

Not extended.

ExtendMode EXT_16X32 = 1

Sprite is extended as 16x32, or Link is extended in Sprites->Link to 16x32.

ExtendMode EXT_32X32 = 2

Sprite is extended as 32x32, or Link is extended in Sprites->Link to 32x32.

ExtendMode EXT_NORMAL = 3

Extended.

ExtendMode EXT_EXTENDED = 3

Extended.

ExtendMode EXT_NOSHADOW = 4

Extended. NPC has no shadow.


enum MoveFlag: ๐Ÿ”— Source

MoveFlag MV_OBEYS_GRAVITY = 0

MoveFlag MV_CAN_PITFALL = 1

MoveFlag MV_CAN_PIT_WALK = 2

MoveFlag MV_CAN_WATERDROWN = 3

MoveFlag MV_CAN_WATER_WALK = 4

MoveFlag MV_ONLY_WATER_WALK = 5

MoveFlag MV_ONLY_SHALLOW_WATER_WALK = 6

MoveFlag MV_ONLY_PIT_WALK = 7

MoveFlag MV_NO_FAKE_Z = 8

MoveFlag MV_NO_REAL_Z = 9

MoveFlag MV_USE_FAKE_Z = 10

npc only.

MoveFlag MV_IGNORE_SOLIDITY = 11

npc only.

MoveFlag MV_IGNORE_BLOCKFLAGS = 12

npc only.

MoveFlag MV_IGNORE_SCREENEDGE = 13

npc only.

MoveFlag MV_USE_SCRIPTED_MOVEMENT_ENGINE = 14

npc only.

MoveFlag MV_NOT_PUSHABLE_BY_SOLIDS = 15

npc only.


Variable descriptions#

const int SpawnScreen ๐Ÿ”— Source

Added in version 3.0.

The screen index this sprite was created on. Does not update as the sprite moves around a region.

Hero: This is always equal to the top-left screen of the current region, equivalent to Game->CurScreen.


const int CurrentScreen ๐Ÿ”— Source

Added in version 3.0.

The screen index this sprite is currently on, updating as it moves around.


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

value Direction (DIR_)

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


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: Not used. Hero: Reset every frame based on current action, unless ScriptTile is > 0.


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.


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.


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

value DrawStyle (DS_)

The drawing style to use.


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.


const int GravityStrength ๐Ÿ”— Source

The current strength of gravity on this sprite.


const int TerminalVelocity ๐Ÿ”— Source

The current terminal velocity of this sprite.


int CustomGravityStrength ๐Ÿ”— Source

If non-zero, overrides the current GravityStrength.


int CustomTerminalVelocity ๐Ÿ”— Source

If non-zero, overrides the current TerminalVelocity.


int Flip ๐Ÿ”— Source

value TransformationType (FLIP_ or ROT_)

How to flip (or rotate) the sprite.


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

value MoveFlag (MV_)

The spriteโ€™s movement flags.


int LightRadius ๐Ÿ”— Source

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


int LightShape ๐Ÿ”— Source

value LightShape (LIGHT_)

The shape of light emitted by this sprite.


const bool SwitchHooked ๐Ÿ”— Source

If the sprite is currently being switch-hooked.

Note: currently not supported for ffc, Hero.


int ShadowSprite ๐Ÿ”— Source

value SpriteID (SP_)

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.


Function descriptions#

void Own(bitmap b) ๐Ÿ”— Source

Grants โ€˜Ownershipโ€™ of the parameter object to this sprite.


void Own(paldata b) ๐Ÿ”— Source

Grants โ€˜Ownershipโ€™ of the parameter object to this sprite.


void Own(file b) ๐Ÿ”— Source

Grants โ€˜Ownershipโ€™ of the parameter object to this sprite.


void Own(directory b) ๐Ÿ”— Source

Grants โ€˜Ownershipโ€™ of the parameter object to this sprite.


void Own(stack b) ๐Ÿ”— Source

Grants โ€˜Ownershipโ€™ of the parameter object to this sprite.


void Own(randgen b) ๐Ÿ”— Source

Grants โ€˜Ownershipโ€™ of the parameter object to this sprite.


void OwnArray(untyped array) ๐Ÿ”— Source

Grants โ€˜Ownershipโ€™ of the parameter object to this sprite.


void OwnObject(untyped object) ๐Ÿ”— Source

Grants โ€˜Ownershipโ€™ of the parameter object to this sprite.