Tiles namespace
Tile sets and maps.
Classes
- struct AnimatedTile
- Represents an animated tile.
- struct AnimatedTileFrame
- Represents a single frame of an animated tile.
- class ITileMapLayerOverride
- Draws images in place of the tiles of layers, as the level editor does for a view from far away.
- class ITileMapOwner
- Interface used to notify tile map owner of various events.
- struct LayerDescription
- Describes the configuration of a tile map layer.
- struct LayerEffectsTarget
- What the special tile layers need from the viewport they are drawn in.
- class LayerLayout
- Tiles of a single TileMapLayer, in blocks and in one of two forms.
- struct LayerTile
- Represents a single tile placed in a tile map layer.
- struct TileCollisionParams
- Describes how the object interacts and collides with the environment.
- class TileMap
- Represents a renderable tile map, consists of multiple layers.
- struct TileMapLayer
- Represents a single tile map layer.
- struct TileMapLayerImage
- An image drawn in place of the tiles of a layer, see ITileMapLayerOverride.
- struct TileMapViewOptions
- Options of how a tile map is shown.
- class TileSet
- Represents tile set used by tile map, consists of texture and collision mask.
Enums
- enum class LayerSpeedModel { Default, AlwaysOnTop, FitLevel, SpeedMultipliers, FromStart }
- Describes how a layer's parallax scrolling speed is interpreted.
- enum class LayerRendererType { Default, Solid, Tinted, XRay, BlurBehind, PaletteShift, SingleColor, AlphaMap = 8, PaletteMapping, Sky = 10, Tunnel, TileMenu = 13, Wave = 14, Cylinder = 15, Reflection = 16 }
- Specifies how a layer is rendered.
-
enum class LayerBlend : std::
uint8_t { Normal, Translucent, ChromaKey, Screen, Multiply, Darken, Lighten, Hue, Saturation, Color, Luminosity, Dissolve, Overlay, HardLight, SoftLight, Difference, Dodge, Burn, Exclusion, Last = Exclusion } - How a layer is blended over what is behind it.
-
enum class TileDestructType : std::
uint8_t { None = 0x00, Weapon = 0x01, Speed = 0x02, Collapse = 0x04, Special = 0x08, Trigger = 0x10, IgnoreSolidTiles = 0x20, VerticalMove = 0x40, SuspendTiles = 0x80 } - Specifies how a tile reacts when collided with.
-
enum class LayerTileFlags : std::
uint8_t { None = 0x00, FlipX = 0x01, FlipY = 0x02, Heat = 0x04, OneWay = 0x10, Collapsing = 0x80 } - Per-tile state flags of a tile placed in a layer.
-
enum class LayerPlacement : std::
uint8_t { Gameplay, ReferenceView } - How the layers of a tile map are placed relative to the view.
Enum documentation
enum class Jazz2:: Tiles:: LayerSpeedModel
#include <Jazz2/Tiles/LayerTypes.h>
Describes how a layer's parallax scrolling speed is interpreted.
Selected per axis in LayerDescription to control how a layer follows the camera — the default parallax model, the same counted from the top/left of the level, locking to the top/left of the screen, fitting the whole layer into view, or treating the speed values as multipliers of the camera size rather than its position.
They are the speed models of JJ2+ (LAYERSPEEDMODEL) under other values, and a layer is placed as JJ2+ places it, measured with Tests/Level/LayerProbe.j2as (see LayerDescription::NORMAL has no model of its own, it's Default without the speed for a layer that has an auto speed.
| Enumerators | |
|---|---|
| Default |
Default model, as |
| AlwaysOnTop |
Ignores all speed and offset settings to be tied to the top/left side of the screen, as |
| FitLevel |
Ignores the speed and auto speed properties, and instead ensures that the full extent of this layer will be visible and no blank space outside of it will be shown. |
| SpeedMultipliers |
Treats the layer's speed and auto speed properties on this axis as multipliers of the current camera size, rather than camera position. |
| FromStart |
As Default, but with the origin at the top/left side of the level whatever the size of the view, and without the inherent offset, as |
enum class Jazz2:: Tiles:: LayerRendererType
#include <Jazz2/Tiles/LayerTypes.h>
Specifies how a layer is rendered.
Stored in LayerDescription to choose the rendering path for a layer — ordinary textured tiles, a solid or color-tinted fill, tiles with their colors moved through the palette, one of the two layers that show something of what is behind them (x-ray and blur), one of the special textured background effects (sky, tunnel, wave or cylinder) used for distant parallax backdrops, or a reflection of what is above its horizon.
The x-ray, blur and reflection layers need a backend that can sample a render target in a shader. Elsewhere an x-ray layer is drawn as a default one showing its animated tiles as they are outside the objects, and a blur or a reflection layer isn't drawn at all, so a level looks as it would without the effects.
The textured background effects take the values the textured layers of JJ2+ have (TEXTURE::Style, the type of the textured background of a layer of the original game). Any number of layers can be textured or reflections, each is drawn with a texture of its own, made of its tiles.
| Enumerators | |
|---|---|
| Default |
Default rendering |
| Solid |
Solid color rendering |
| Tinted |
Color-tinted rendering |
| XRay |
X-ray — the last frame of an animated tile of the layer is its mask frame, shown only where an object is behind it, in the object's silhouette. Elsewhere the tile animates through the frames before it as usual, and a tile of a single frame shows nothing at all. Any frame may be the empty tile, which cuts the object out of the layer or shows the tile only over the object. Static tiles are drawn as usual. |
| BlurBehind |
Blur behind — the layer isn't drawn, it shows what is below it instead, per pixel by the channels of its tiles: moved horizontally by red and vertically by green (128 leaves it in place, every step away from it moves it by a quarter of the layer's pixel, so up to 32 pixels either way), mirrored vertically by blue, and blurred by alpha - the reflection too, so a gradient fades a reflection out into a blur. A pixel of no alpha does nothing at all, whatever its colour, so alpha 1 is one that moves or mirrors without a blur. The alpha of the layer's color sets how strong all of it is. The mirror line of a reflection is the first visible row of the topmost tile of the uninterrupted column of reflective tiles it belongs to, so a taller column reflects more of what is above it. The blur follows the blur effects option, the rest is always shown. |
| PaletteShift |
Palette shift, as |
| SingleColor |
Single color, as |
| AlphaMap |
Alpha map, as |
| PaletteMapping |
Palette mapping, as |
| Sky |
Textured background — sky, as Any textured background can also be drawn only where the layer is placed, as an ordinary layer would be, as |
| Tunnel |
Textured background — tunnel, as |
| TileMenu |
Textured background — tile menu, as |
| Wave |
Textured background — wave, as |
| Cylinder |
Textured background — cylinder, as |
| Reflection |
Reflection, as |
enum class Jazz2:: Tiles:: LayerBlend : std:: uint8_t
#include <Jazz2/Tiles/LayerTypes.h>
How a layer is blended over what is behind it.
The sprite modes of JJ2+ a layer can be drawn with (see LayerDescription::
Translucent, ChromaKey and the blend modes from Darken on need a backend that can sample a render target in a shader, they read what is behind the layer. Elsewhere a textured background is drawn opaque, a layer of tiles of ChromaKey isn't drawn at all, and one of another blend mode is drawn as an ordinary one.
The blend modes from Darken on are those of JJ2+ (SPRITE::BLEND_DARKEN and the like), as image editors have them: the color of the layer and the color behind it make the color shown, which is mixed over what is behind it as far as LayerDescription::
| Enumerators | |
|---|---|
| Normal |
Drawn as the renderer type draws it. |
| Translucent |
As opaque as LayerDescription:: |
| ChromaKey |
Only over the pixels behind it of the color of the palette entry LayerDescription:: A part of the scene painted in that color is a window the layer shows through. |
| Screen |
Lightens what is behind it, mixed over it as far as LayerDescription:: |
| Multiply |
Darkens what is behind it, mixed over it as far as LayerDescription:: |
| Darken |
The darker of each channel, as |
| Lighten |
The lighter of each channel, as |
| Hue |
The hue of the layer with the saturation and the luminosity behind it, as |
| Saturation |
The saturation of the layer with the hue and the luminosity behind it, as |
| Color |
The hue and the saturation of the layer with the luminosity behind it, as |
| Luminosity |
The luminosity of the layer with the hue and the saturation behind it, as |
| Dissolve |
As many pixels of the layer drawn as it's opaque, the others not at all, as |
| Overlay |
Multiplied or screened by what is behind it, as |
| HardLight |
Multiplied or screened by the layer, as |
| SoftLight |
Darkened or lightened softly by the layer, as |
| Difference |
The difference of each channel, as |
| Dodge |
What is behind it brightened by the layer, as |
| Burn |
What is behind it darkened by the layer, as |
| Exclusion |
Like Difference, but of less contrast, as |
| Last |
The last blend this version knows, a layer of a later one is drawn as its renderer type draws it. |
enum class Jazz2:: Tiles:: TileDestructType : std:: uint8_t
#include <Jazz2/Tiles/TileDestructType.h>
Specifies how a tile reacts when collided with.
Assigned per tile to describe what can destroy or trigger it (a weapon hit, movement speed, a special move, collapsing or acting as a trigger) along with collision modifiers such as ignoring solid tiles or restricting movement to the vertical axis. Supports a bitwise combination of its member values.
| Enumerators | |
|---|---|
| None |
No collision |
| Weapon |
Destroyed by a weapon |
| Speed |
Destroyed by movement speed |
| Collapse |
Collapsible tile |
| Special |
Destroyed by a special move |
| Trigger |
Trigger tile |
| IgnoreSolidTiles |
Solid tiles are ignored during collision |
| VerticalMove |
Movement is vertical |
| SuspendTiles |
Masks of tiles players hang from (vines, hooks) are solid too |
enum class Jazz2:: Tiles:: LayerTileFlags : std:: uint8_t
#include <Jazz2/Tiles/TileMap.h>
Per-tile state flags of a tile placed in a layer.
Stored on each LayerTile to mark horizontal/vertical flipping, one-way collision and the runtime-only state of a tile already queued in the active collapsing list. Supports a bitwise combination of its member values.
| Enumerators | |
|---|---|
| None |
None |
| FlipX |
Flipped horizontally |
| FlipY |
Flipped vertically |
| Heat |
Heat effect, as the tile type of JJ2+ — every row of pixels of the tile is drawn moved left or right by up to 2 pixels, into the tiles next to it, by a fixed table of the 32 rows of a tile that scrolls up a row every 4 game ticks of the original (70 a second), measured in the original. Drawn so only in an ordinary layer and where the shader of it is available, as an ordinary tile otherwise. |
| OneWay |
One-way collision |
| Collapsing |
Runtime-only: tile is already queued in the active collapsing list |
enum class Jazz2:: Tiles:: LayerPlacement : std:: uint8_t
#include <Jazz2/Tiles/TileMap.h>
How the layers of a tile map are placed relative to the view.
| Enumerators | |
|---|---|
| Gameplay |
As in the game, by the view that is drawn. |
| ReferenceView |
As in the game, by a view of TileMapViewOptions:: The layers sit where the game would put them for the view of a player at the center, and are extended across a view of another size — the level editor zoomed out shows more of every layer, not layers moved apart. |