Jazz2::Scripting::Legacy::jjLAYER class

A tilemap layer of the level.

Reference-counted proxy for one of the level's parallax tile layers, mirroring the original JJ2+ jjLAYER. Exposes the layer's size, scrolling speeds and offsets, parallax/auto-speed and texture-background modes, and per-tile get/set access. The level loader keeps one proxy per engine layer and pushes writable fields back each frame (see LevelScriptLoader::GetLayerProxy); reached from script via jjLayers.

Public static functions

static auto CreateFromSize(std::uint32_t width, std::uint32_t height) -> jjLAYER*
Returns a new layer of the given size.
static auto CreateCopy(jjLAYER* other) -> jjLAYER*
Returns a new layer copied from another.
static auto get_jjLayers(int32_t index) -> jjLAYER*
Returns the level layer at the specified index.
static auto jjLayerOrderGet() -> CScriptArray*
Returns the draw order of all layers.
static auto jjLayerOrderSet(const CScriptArray& order) -> bool
Sets the draw order of all layers.
static auto jjLayersFromLevel(const String& filename, const CScriptArray& layerIDs, int32_t tileIDAdjustmentFactor) -> CScriptArray*
Loads the given layers from another level file.
static auto jjTilesFromTileset(const String& filename, std::uint32_t firstTileID, std::uint32_t tileCount, const CScriptArray* paletteColorMapping) -> bool
Imports tiles from another tileset into the current one.

Constructors, destructors, conversion operators

jjLAYER()
Creates a new instance.
~jjLAYER()

Public functions

void AddRef()
Increments the reference count.
void Release()
Decrements the reference count.
auto operator=(const jjLAYER& o) -> jjLAYER&
auto get_spriteMode() const -> std::uint32_t
Returns the sprite blend mode used by the layer.
auto set_spriteMode(std::uint32_t value) const -> std::uint32_t
Sets the sprite blend mode used by the layer.
auto get_spriteParam() const -> std::uint8_t
Returns the parameter for the layer's sprite blend mode.
auto set_spriteParam(std::uint8_t value) const -> std::uint8_t
Sets the parameter for the layer's sprite blend mode.
void setXSpeed(float newspeed, bool newSpeedIsAnAutoSpeed) const
Sets the horizontal scrolling speed, optionally as an auto-speed.
void setYSpeed(float newspeed, bool newSpeedIsAnAutoSpeed) const
Sets the vertical scrolling speed, optionally as an auto-speed.
auto getXPosition(const jjPLAYER* play) const -> float
Returns the layer's horizontal position for the given player's camera.
auto getYPosition(const jjPLAYER* play) const -> float
Returns the layer's vertical position for the given player's camera.
auto GetTextureMode() const -> std::int32_t
Returns the textured-background mode of the layer.
void SetTextureMode(std::int32_t value) const
Sets the textured-background mode of the layer.
auto GetTexture() const -> std::int32_t
Returns the texture used by the layer.
void SetTexture(std::int32_t value) const
Sets the texture used by the layer.
auto tileGet(int xTile, int yTile) -> std::uint16_t
Returns the tile at the given tile coordinates.
auto tileSet(int xTile, int yTile, std::uint16_t newTile) -> std::uint16_t
Sets the tile at the given tile coordinates.
void generateSettableTileArea(int xTile, int yTile, int width, int height)
Marks a rectangular tile area as runtime-settable.
void generateSettableTileAreaAll()
Marks the whole layer as runtime-settable.

Public variables

std::int32_t width
Layer width in tiles.
std::int32_t widthReal
Actual (untruncated) layer width in tiles.
std::int32_t widthRounded
Layer width rounded up for tiling.
std::int32_t height
Layer height in tiles.
float xSpeed
Horizontal parallax scrolling speed.
float ySpeed
Vertical parallax scrolling speed.
float xAutoSpeed
Horizontal automatic scrolling speed.
float yAutoSpeed
Vertical automatic scrolling speed.
float xOffset
Horizontal scrolling offset.
float yOffset
Vertical scrolling offset.
float xInnerSpeed
Horizontal inner parallax speed.
float yInnerSpeed
Vertical inner parallax speed.
float xInnerAutoSpeed
Horizontal inner automatic speed.
float yInnerAutoSpeed
Vertical inner automatic speed.
std::int32_t rotationAngle
Rotation angle of the layer.
std::int32_t rotationRadiusMultiplier
Radius multiplier applied when rotating the layer.
bool tileHeight
Whether the layer tiles vertically.
bool tileWidth
Whether the layer tiles horizontally.
bool limitVisibleRegion
Whether the layer's visible region is limited.
bool hasTileMap
Whether the layer has a tile map.
bool hasTiles
Whether the layer contains any tiles.
std::int32_t SpeedModeX
Horizontal speed mode of the layer.
std::int32_t SpeedModeY
Vertical speed mode of the layer.