Jazz2::Scripting::Legacy::jjPLAYERDRAW struct

How a player is drawn in this tick.

Passed to the onPlayerDraw() hook, already filled in with how the game would draw the player. Changes apply to this one drawing only. If the script changes curFrame, angle, xOffset, yOffset, xScale, yScale, spriteMode or spriteParam, the given frame is drawn in place of the player until the next tick. Setting sprite to false hides the player.

Public functions

auto get_shield(std::int32_t shield) const -> bool
Returns whether the given shield is drawn around the player.
auto set_shield(std::int32_t shield, bool enable) -> bool
Sets whether the given shield is drawn around the player.
auto get_player() const -> jjPLAYER*
Returns the player being drawn.

Public variables

bool name partially supported
Whether the player's name is drawn.
bool sprite
Whether the player's sprite is drawn.
bool sugarRush
Whether the stars of a sugar rush are given off in this tick.
bool gunFlash
Whether the muzzle flash is drawn.
bool invincibility partially supported
Whether the invincibility effect is drawn.
bool trail
Whether the trail of light behind a fast player is drawn.
bool morphingExplosions partially supported
Whether the explosions of morphing are drawn.
bool airboardBouncingMotion partially supported
Whether the player bobs up and down as on an airboard.
bool airboardPuff partially supported
Whether puffs of an airboard are drawn behind the player.
std::int32_t spriteMode
Sprite mode used to draw the player.
std::uint8_t spriteParam
Parameter of the sprite mode.
std::int32_t lightType
Type of light the player emits in this tick.
std::int8_t light
Size of the light the player emits in this tick.
std::int32_t layer
Layer the player is drawn in front of.
std::uint32_t curFrame
Sprite frame to draw.
std::int32_t angle
Angle the sprite is drawn at.
float xOffset
Horizontal offset of the drawing from the player's position in pixels.
float yOffset
Vertical offset of the drawing from the player's position in pixels.
float xScale
Horizontal scale of the drawing.
float yScale
Vertical scale of the drawing.
std::int32_t flag partially supported
Color of the flag drawn behind the player.
std::uint32_t _shields
Bits of the shields drawn around the player, by SHIELD::Shield.
jjPLAYER* _player
The player this draw configuration belongs to.

Function documentation

bool Jazz2::Scripting::Legacy::jjPLAYERDRAW::get_shield(std::int32_t shield) const

Returns whether the given shield is drawn around the player.

Indexed by SHIELD::Shield, true for the shield the player has. A player is drawn with one shield, of the ones the script leaves on the lowest.

jjPLAYER* Jazz2::Scripting::Legacy::jjPLAYERDRAW::get_player() const

Returns the player being drawn.

The handle can't be replaced, but the player's own properties can be changed through it.

Variable documentation

bool Jazz2::Scripting::Legacy::jjPLAYERDRAW::name

Whether the player's name is drawn.

bool Jazz2::Scripting::Legacy::jjPLAYERDRAW::invincibility

Whether the invincibility effect is drawn.

bool Jazz2::Scripting::Legacy::jjPLAYERDRAW::morphingExplosions

Whether the explosions of morphing are drawn.

bool Jazz2::Scripting::Legacy::jjPLAYERDRAW::airboardBouncingMotion

Whether the player bobs up and down as on an airboard.

True by default while the player is on an airboard.

bool Jazz2::Scripting::Legacy::jjPLAYERDRAW::airboardPuff

Whether puffs of an airboard are drawn behind the player.

True by default while the player is on an airboard.

std::int32_t Jazz2::Scripting::Legacy::jjPLAYERDRAW::spriteMode

Sprite mode used to draw the player.

Defaults to jjPLAYER::spriteMode.

std::uint8_t Jazz2::Scripting::Legacy::jjPLAYERDRAW::spriteParam

Parameter of the sprite mode.

Defaults to jjPLAYER::spriteParam.

std::int32_t Jazz2::Scripting::Legacy::jjPLAYERDRAW::lightType

Type of light the player emits in this tick.

Defaults to jjPLAYER::lightType.

std::int8_t Jazz2::Scripting::Legacy::jjPLAYERDRAW::light

Size of the light the player emits in this tick.

Defaults to jjPLAYER::light.

std::int32_t Jazz2::Scripting::Legacy::jjPLAYERDRAW::layer

Layer the player is drawn in front of.

4 by default.

std::uint32_t Jazz2::Scripting::Legacy::jjPLAYERDRAW::curFrame

Sprite frame to draw.

An index into jjAnimFrames, by default jjPLAYER::curFrame. Changing it only changes the look, collisions still use the player's real frame.

std::int32_t Jazz2::Scripting::Legacy::jjPLAYERDRAW::angle

Angle the sprite is drawn at.

Uses the same units as jjCANVAS::drawRotatedSprite(). 0 by default.

float Jazz2::Scripting::Legacy::jjPLAYERDRAW::xOffset

Horizontal offset of the drawing from the player's position in pixels.

0 by default.

float Jazz2::Scripting::Legacy::jjPLAYERDRAW::yOffset

Vertical offset of the drawing from the player's position in pixels.

0 by default.

float Jazz2::Scripting::Legacy::jjPLAYERDRAW::xScale

Horizontal scale of the drawing.

1 or -1 by default, depending on which way the player faces.

float Jazz2::Scripting::Legacy::jjPLAYERDRAW::yScale

Vertical scale of the drawing.

1 by default.

std::int32_t Jazz2::Scripting::Legacy::jjPLAYERDRAW::flag

Color of the flag drawn behind the player.

A TEAM::Color value.