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

RB.CameraSet

Method  -  Static

public static void CameraSet(Vector2i pos)

Parameters

pos Vector2i Position

Returns

Nothing.

Description

Set the current camera position which will offset all drawing that follows. This is especially useful for games that have a scrolling play field.

Example

const int LAYER_TERRAIN = 0;

void Render()
{
    var oldCameraPos = RB.CameraGet();

    RB.CameraSet(worldPos);
    RB.DrawMapLayer(LAYER_TERRAIN);
    RB.DrawSprite("hero"new Vector2i(00));

    RB.CameraSet(oldCameraPos);
}

See Also

RB.CameraGet
RB.CameraReset

See Docs

Features - Camera