AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

RB.DrawMapLayer

Method  -  Static

public static void DrawMapLayer(int layer)
public static void DrawMapLayer(int layer, Vector2i pos)

Parameters

layer int Layer number to draw
pos Vector2i Offset

Returns

Nothing.

Description

Draws the given map layer to the display. The layer is drawn such that tile at position (0, 0) is aligned with the top left corner of the display by default. The optional pos parameter can be used to shift the tilemap in any direction.

RB.DrawMapLayer also responds to the current camera setting as set by RB.CameraSet.

Example

const int LAYER_TERRAIN = 0;
const int LAYER_WALLS = 1;

void Render() {
    // Move the camera to the right
    RB.CameraSet(new Vector2i(640));

    // Draw two map layers, which will be shifted by 64 pixels due to the
    // camera setting above
    RB.DrawMapLayer(LAYER_TERRAIN);
    RB.DrawMapLayer(LAYER_WALLS);

    // Draw a sprite which will also be shifted by the camera setting along
    // with the tilemap
    RB.DrawSprite("hero"new Vector2i(3232));
}

See Also

RB.CameraSet

See Docs

Features - Tilemaps
Features - Camera