reckfellENGINE

2D: first objects and running a level

Coordinates, hierarchy, visibility, camera and first-run diagnosis.

On this page

What makes a 2D level

Entity2D stores position, rotation and scale. This type alone neither draws anything nor creates collisions.

TaskSuitable type
Display an imageSprite2D with a Texture assigned
Control a character with physical collisionsCharacterBody2D with a CollisionShape2D child
Detect entry into an areaArea2D with a CollisionShape2D child
Add an interfaceControl; CanvasLayer for a separate layer
Change the view of the game worldCamera2D

Character visuals and collision geometry are separate objects. Sprite2D does not acquire collisions because its texture depicts a wall. Start with the first 2D game, which configures shapes, layers, movement and hit handling.

Coordinates and the parent

In 2D, positive X points right and positive Y points down. Vector2.Up is (0, -1). Position is local; GlobalPosition is in the corresponding canvas space.

A child Entity2D's final placement depends on its parent CanvasItem transform, including rotation and scale. An ordinary Entity between them breaks this chain. TopLevel has separate rules: it does not inherit its parent CanvasItem transform. See 2D transforms.

A canvas coordinate unit does not necessarily equal a physical screen pixel: Camera2D zoom and stretch settings change the result. Do not compensate for a camera error by changing Position arbitrarily.

Work in the editor

Switch to the 2D workspace. Select an object in the tree, then edit Position, Rotation and Scale in the inspector or use the move, rotate and scale tools. To locate an object, use the action that focuses the selection. Check its key in the editor shortcut settings: bindings can be changed.

The 2D workspace is an editor view, not a guaranteed game frame. Simple 2D output does not require Camera2D; when using one, check the final view by running the document. For a HUD that must not move with the world, use canvas layers.

Choose Control for interfaces: its sizes, anchors and containers address window layout. Entity2D with manually assigned coordinates does not replace a responsive interface.

Verify the first result

  1. Assign a texture to Sprite2D and place it in the visible area.
  2. Run the intended document: the image must appear in the game, not only in the editor.
  3. Move the parent and confirm that its child behaves as intended.
  4. If physics is needed, configure the shape, layers and masks separately; test an actual collision.
ProblemCheck
Nothing is visibleTexture, object and parent Visible flags, Modulate alpha, camera position
Another object covers itDraw order, ZIndex and CanvasLayer
Passes through a wallPhysics body type, CollisionShape2D, layers and masks
Interface moves with the worldCanvasLayer and HUD hierarchy
Position changes unexpectedlyPosition versus GlobalPosition, parent type, rotation and scale

Next tasks: movement, sprite animation, tile-based levels.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.