Skip to main content

The scene viewport

The Scene panel shows the open scene as the game draws it, through the editor's own camera. This page covers moving around, selecting, the Move, Rotate, Scale and Rect tools with their handles and snapping, the gizmos components draw, Preview, and dropping assets into the scene.

A sprite and a light selected together with the Move tool. The light's gizmo shows its radius.
DoHow
PanDrag with the middle or right mouse button, or hold Space and drag. Works with any tool. The Hand tool (H) pans with the left button.
Zoom around the pointerMouse wheel
Zoom in stepsCtrl= and Ctrl- step through 12.5%, 25%, 50%, 100%, 200%, 300%, 400%, 600%, 800%, 1200% and 1600%
Show at 100%Ctrl1
Pan sidewaysShift and the wheel, or a touchpad's horizontal scroll
Frame the selectionF
Frame the whole sceneShiftF
Go to the originHome

The zoom bar in the bottom right corner of the panel shows the zoom and has buttons for the same steps and for framing. In a narrow Scene panel it leaves out the framing buttons, and then the step buttons, whose keys and the wheel still work. The commands are also in Scene › View. Edit › Settings… › Viewport sets how far one wheel notch zooms and whether zooming is smooth.

The grid adapts to the zoom: when cells get too small, it doubles its spacing, and every fourth line is drawn stronger. The red and green lines are the X and Y axes through the origin. Y points down, as in the game. While a tile tool is active, the grid shows the edited map's cells instead; see Tile grid.

The viewport remembers its camera for each scene, so a scene opens where you left it. A scene opened for the first time is framed to fit.

Select​

The Select tool (Q) is the default tool.

DoHow
Select an entityClick it
Add to the selectionShift+click
Add or remove one entityCtrl+click
Select everything in an areaDrag on empty space. Everything the rectangle touches is selected.
Move the selectionDrag a selected entity
Select everything, nothingCtrlA, Escape

Entities without anything visible, such as cameras, lights and empty groups, show an icon you can click. The Entity icons toggle at the top right of the Scene panel hides those icons.

The selection is shared with the hierarchy and the inspector: whatever you select in one is selected in the others. Locked entities cannot be picked in the viewport, and hidden entities are not drawn; you set both in the hierarchy.

Transform tools​

The tool rail on the left of the Scene panel holds the tools. When the panel is too short for all of them, the rail continues in another column. When it is too narrow for that as well, the last button lists the tools left over with their keys, and shows the active tool when it is one of them.

The transform tools work on every selected entity at once.

ToolKeyHandlesModifiers
MoveWDrag an arrow to move along it, or the square to move freely.Shift keeps to one axis. Ctrl snaps to the grid.
RotateEDrag the ring to turn around the pivot.Ctrl snaps to 15°.
ScaleRDrag an axis handle to stretch along it, or the center to scale evenly.Ctrl snaps to tenths.
RectTDrag an edge or corner to resize, inside to move.Alt resizes around the center, Shift keeps the aspect ratio, Ctrl snaps.
The Rotate tool's ring around the hero's pivot, at its feet.

While you drag, the entities change at once and a readout next to the pointer shows the change: the distance moved, the angle, the scale factor or the new size. When you release, the whole drag becomes one undo step. Press Escape during a drag to cancel it.

Where the handles sit​

Two toggles in the tool options bar decide where the handles are and which way they point:

ToggleKeyOffOn
CenterZThe handles sit at the pivot of the last selected entity.The handles sit at the center of the selection.
LocalXThe handles follow the world axes.The handles turn with the entity's rotation.

Snapping​

The Snap toggle (CtrlShiftG) snaps moves to the grid. The field next to it sets the grid size in world units, 32 by default. Holding Ctrl while you drag snaps without turning snapping on. Rotation snaps to the rotation step, 15° by default, which you can change in Edit › Settings… › Viewport. The grid toggle (CtrlG) shows or hides the grid without changing snapping.

Gizmos​

Selected entities show gizmos for their components: shapes you can see, often with round handles you can drag with any tool. Unselected entities show their gizmos faintly, so you can see where lights and colliders are.

ComponentGizmoHandles
CameraThe area the game shows at the camera's zoom, labeled with its name, design size, scale mode and zoom; with Expand and Crop also a fainter dashed frame for what the window size shows; and its bounds when set
Light 2DThe radius, the inner radius and a spot light's coneRadius, inner radius, cone (Ctrl snaps to 15°), direction
Collider 2DThe outline in green; triggers are dashedWidth, height, radius and polygon points
Shadow Caster 2DA dashed violet outline
Particle EmitterThe emission shape and the live bounds of the particles, with their count
Audio Source (spatial)The minimum and maximum distanceBoth distances
The main camera's frame at the platformer's 640 × 360 design size, with the scale mode and zoom in the label.

As with the transform tools, Ctrl snaps while you drag a gizmo handle and Escape cancels.

Preview​

The viewport only redraws when something changes, so sprites stand still, particles do not emit and lights do not flicker while you edit. That keeps the editor quiet and saves power. Turn on Preview in the tool options bar (CtrlAltP) to run animations, particles and lights in the viewport without running gameplay: scripts and physics stay off. A Preview badge appears in the corner of the Scene panel while it is on.

Drop assets into the scene​

Drag assets from the Assets panel into the viewport to create entities where you drop them:

AssetCreates
A textureAn entity with a Sprite
A .hexy mapAn entity with a Tile Map Renderer
A .tparticles presetAn entity with a Particle Emitter playing the preset
A .wav or .ogg soundAn entity with an Audio Source
A .tprefab prefabAn instance of the prefab

The entity is named after the file. With snapping on, the drop point snaps to the grid. Dropping several assets at once creates one entity for each, as one undo step. You can drop the same assets on the hierarchy to create them under a particular entity.