Nirvana2D [RCBasic Doc]

## Nirvana2D Stage Editor

The stage editor is where tiles, sprites, and background layers are brought together to form the stages that you load into your game.

## The Viewport

The main part of the stage editor you will interact with is the viewport.

#1 - Layer Selection - Select the active layer

- The active layer type will determine which tools are usable
- Tile Layers are the only layers where the tile info in #6 and #7 are shown
- Sprites and Collision shapes are only able to be added or edited on a Sprite Layer
- If the grid is shown, it will be aligned with the active layer.

#2 - Set Camera - You can use this to move instantly to a desired position in the stage

#3 - Placement Mode - The left button is for free placement and the second button is for grid snapping

#4 - Editor Viewport - This is where a majority of editing is done

- Movement - While the mouse is hovered over the viewport, use W/A/S/D to navigate. The speed of this movement can be changed from settings.
- If a select tool (ie. tile select, sprite select, or shape select) is active, you can hold Ctrl to select multiple items
- Multiple selections can also be made by holding Ctrl with Box select

#5 - Screen Mouse Info - The position of the mouse on the screen

#6 - Stage Mouse Info - The position of the mouse in the stage

- The Tile Positions are the top left corner of the tile the mouse is located in

#7 - Camera Info - The position of the camera in the stage

- The Tile Positions are the top left corner of the tile at the top left corner of the screen

## Stage Manager

This is where you create stages and manage stage properties

- - Create new Stage
- - Delete highlighted stage
- - Edit the properties for a stage
- - Copy a stage

## Layer Settings

This is where you create layers and edit layer settings

#1 - Tool Bar

- New Layer - Create a new layer
- Copy Layer - Copies a layer
- Show All - Makes all layers visible
- Hide All - Hides all layers

#2 - Organizer - Change the order of layers or delete layers

#3 - Layer List - Select a layer in the list to edit its properties and toggle the check box to view/hide individual layer

#4 - Layer Settings

- Type - The type of layer selected. There are 5 types of layers: sprite, tile, isometric tile, canvas 2d, and canvas 3d.
- Name - The name of the layer
- HScroll - The speed the layer scrolls horizontally
- VScrol - The speed the layer scrolls vertically
- Alpha - The transparency value

#5 - Sprite Layers have extra settings that can be changed.

- Sprite Grid - Grid type can be either SQUARE or ISOMETRIC and determines how sprites move and snap when snap tile movement is enabled.
- Sort By - This setting will override SpriteZ values and determines the priority sprites are rendered in
- Order - This determines whether the priority set by Sort By is in ascending or descending order
- Shape Data - You can use this to have the editor generate the shapes when generating code or just export the shape data so you can handle collision yourself

## Editor Settings

This is where you can change editor settings

#1 - Viewport

- Show Shapes - This determines whether stage collision shapes are viewable when the layer they are created on is not active
- Show Grid - Show the tile grid
  - NOTE: Tile grid is aligned to the active layer so layers with different HScroll and VScroll speeds will have different grid alignments
- Grid Color - The color of the grid

#2 - Camera

- Move Speed - The speed the viewport scrolls at when using W/A/S/D movement

## Tile Map Tools

These tools are only usable when a tile layer is selected.

NOTE: There is a subset of these tools available on sprite layers. The sprite layer tools will create a sprite with the selected tiles.

#1 - Tools

- Select - Select a single tile
  - Hold Ctrl to do multiple selections
- Box Select - Select all tiles in box
  - Hold Ctrl to do multiple selections
- Move - Move the selected tiles
- Set Tile - Place selected tiles in stage
  - You can select multiple tiles in the tile select viewport
  - Right click to delete the tile at the mouse position in stage viewport
- Copy Tile - Copies the selected tiles
- Fill Tile - Flood fills with a selected tile
- Delete Selected Tiles - Delete selected tiles

#2 - Tileset - Shows the tileset for the current layer

#3 - Viewport - Tileset Selection

## Sprite Tools

These tools are only usable when a sprite layer is selected.

#1 - Sprite Tools

- Select - Select a single sprite
  - Hold Ctrl to do multiple selections
- Box Select - Select all tiles in box
  - Hold Ctrl to do multiple selections
- Move - Move the selected sprites
  - If Placement mode is set to Tile Snap then the sprite will snap to the closest tile position
- Rotate - Rotates the selected sprites
- Scale - Scale the selected sprites
- New Sprite - Add a sprite to the current layer
- Delete Sprite - Delete the selected sprite
- Copy Sprite - Copy the selected sprite
- Center on sprite - Center the viewport on the selected sprite

#2 - Sprite List - Select a sprite

#3 - Sprite Properties

- Sprite ID - Name of the selected sprite
- Body Type - Type of physics body
- Animation - The default animation set on the sprite when stage first loads
- Position - The position of the sprite
- Rotation - The angle the sprite is rotated by
- Scale - The scale of the sprite
- Render Settings - Additional render settings

## Collision Shape Tools

These tools are only usable when a sprite layer is selected.

#1 - Shape Tools

- Select - Select a single point
  - Hold Ctrl to do multiple selections
  - NOTE: While Ctrl is down, only points on the selected shape will be selected
- Box Select - Select all points in box
  - Hold Ctrl to do multiple selections
  - NOTE: While Ctrl is down, only points on the selected shape will be selected
- Move - Move the selected points
  - If Placement mode is set to Tile Snap then the points will snap to the closest tile position
- Draw Shape - Draw the shape in the stage viewport
- Create Shapes
  - Box - An axis aligned rectangle
  - Polygon - A closed polygon
  - Chain - A shape made of connected points
  - Circle - A circle
- Delete Shape - Deletes the selected shape

#2 - Shape List - List of shapes in the current layer

#3 - Shape Properties - Different properties are available for different shapes

## Background Image

A background image can only be set for a Canvas 2D layer.

#1 - Render Type - Determines how the image will be drawn

- Normal - Draw the image at its native resolution
- Stretched - Stretch the image to the size of the viewport
- Tiled - Tile the image as the stage scrolls
  - NOTE: Background tile will scroll at layer scroll speed

#2 - Layer Image - The image to draw on the layer