jjPLAYERDRAW class JJ2+
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.
Properties
- 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
- int angle
- Angle the sprite is drawn at
- uint curFrame
- Sprite frame to draw
- TEAM::Color flag partially supported
- Color of the flag drawn behind the player
- bool gunFlash partially supported
- Whether the muzzle flash is drawn
- bool invincibility partially supported
- Whether the invincibility effect is drawn
- int layer
- Layer the player is drawn in front of
- int8 light partially supported
- Intensity of the light the player emits
- LIGHT::Type lightType partially supported
- Type of light the player emits
- bool morphingExplosions partially supported
- Whether the explosions of morphing are drawn
- bool name partially supported
- Whether the player's name is drawn
- jjPLAYER@ player read-only
- The player being drawn
- bool shield[SHIELD::Shield] partially supported
- Whether the given shield is drawn around the player
- bool sprite C++
- Whether the player's sprite is drawn
- SPRITE::Mode spriteMode
- Sprite mode used to draw the player
- uint8 spriteParam
- Parameter of the sprite mode
- bool sugarRush partially supported
- Whether the sugar rush effect is drawn
- bool trail partially supported
- Whether the trail behind a fast player is drawn
- float xOffset
- Horizontal offset of the drawing from the player's position in pixels
- float xScale
- Horizontal scale of the drawing
- float yOffset
- Vertical offset of the drawing from the player's position in pixels
- float yScale
- Vertical scale of the drawing
Property documentation
bool jjPLAYERDRAW:: airboardBouncingMotion
Whether the player bobs up and down as on an airboard
True by default while the player is on an airboard.
bool jjPLAYERDRAW:: airboardPuff
Whether puffs of an airboard are drawn behind the player
True by default while the player is on an airboard.
int jjPLAYERDRAW:: angle
Angle the sprite is drawn at
Uses the same units as jjCANVAS::drawRotatedSprite(). 0 by default.
uint 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.
bool jjPLAYERDRAW:: invincibility
Whether the invincibility effect is drawn
LIGHT::Type jjPLAYERDRAW:: lightType
Type of light the player emits
bool jjPLAYERDRAW:: morphingExplosions
Whether the explosions of morphing are drawn
bool jjPLAYERDRAW:: shield[SHIELD::Shield]
Whether the given shield is drawn around the player
Indexed by SHIELD::Shield.
SPRITE::Mode jjPLAYERDRAW:: spriteMode
Sprite mode used to draw the player
Defaults to jjPLAYER::spriteMode.