Cameras and builds
What the player sees, and where it ships.
Cameras
Cameras belong to the game, not to a scene, and they are not components. Define them in Project Settings → Cameras, stored in game.json. A new project has one, named Main. Each scene chooses which cameras show it.
A camera shows the world at its view position (X, Y is the world point at the top-left of the view) inside a rectangle of the screen. It is 1:1 and pixel perfect. There is no zoom. A 72×40 minimap costs 72×40 pixels. A scene listed on several cameras is drawn once each: split screen, or a main view plus a map. A scene with no camera covers the whole screen with world equal to screen. That is the HUD.
X and Y are integers. A smooth follow keeps its own float and assigns Position, which rounds. Follow, bounds, shake, and rooms are your script. Every Play starts cameras from Project Settings again.
using System.Numerics;
using WillEngine.Core.Components;
using WillEngine.Core.Entities;
using WillEngine.Core.World;
public class CameraFollow : Component
{
public GameObject Target;
public float Smoothing = 8f;
private Vector2 _pos;
public override void Initialize() => _pos = Cameras.Main.Position;
public override void OnUpdate(float dt)
{
if (Target == null) return;
Camera cam = Cameras.Main;
var goal = new Vector2(
Target.Transform.WorldX - cam.Width / 2f,
Target.Transform.WorldY - cam.Height / 2f);
_pos += (goal - _pos) * MathF.Min(1f, Smoothing * dt);
cam.Position = _pos;
}
}
Cameras.Main is the camera named Main, or the first one. ScreenToWorld and WorldToScreen convert through that camera. Mouse and touch positions from Input are screen pixels; convert them before you compare with object positions. In a scene with no camera, screen and world are the same point.
Tweens
A Timeline component (Add Component → Animation, namespace WillEngine.Core.Components.Tween) plays tweens, sets, and calls. To moves toward a value read when the tween starts. By adds. Set and Call take no time. Steps run in order unless you place them with At or Delay.
using WillEngine.Core.Components.Tween;
tl.To(target, seconds, t => t.LocalRotation, 90f)
.Ease(EaseType.QuadOut)
.And(t => t.LocalX, 5f);
Sequences
A .wseq asset is a keyframed piece made in View → Sequence: a character move, a UI beat, a cutscene. A SequencePlayer on an object plays it on that object and its children.
Tracks are Value (numbers and vectors, eased), Set (any member, at a key), Event (a method by name), Sprite (an animator clip), Audio, Object (activate, spawn a prefab, load a scene), Marker (a named signal, or a wait until Continue()), and Sequence (another sequence, up to 8 deep). Targets are a path from the player (., Body/Sprite, ..), a binding you fill on the player, or the scene.
PlayOnStart, Loop, and Speed are the usual fields. Play, Pause, Resume, Stop, Seek, Skip, and Restore drive it. Finished and Signal are the events scripts wait on. Preview in the editor shows the sequence without entering Play; Record turns edits into keys. Scripts, clip playback, spawns, and scene loads do not run in preview.
Build targets
The Build panel has one page per target. A game builds the start scene and the scenes marked In Build, through the build module that matches this editor version.
| Target | What you get |
|---|---|
| Windows, Linux | An output folder. Choose an icon, whether to include the .NET runtime, and whether to show a console. Windows can embed the icon. |
| Android | APK or AAB, Test or Release with a keystore, orientation, and Build and Run to a phone on USB. The toolchain is installed from the Build panel when you ask. It is not in the editor installer. |
| Web | WebGL2, ahead-of-time WebAssembly. Build and Run serves the folder locally. A click starts the game, which is what browsers require before audio can play. The WebAssembly tools are installed from the Build panel when you ask. |
macOS and iOS are later. Scripts stay platform-neutral: no Windows-only APIs, no writing files outside the save folder, no threads touching the scene.
Scaling, in Project Settings, is PixelPerfect (whole-number scale with bars, the default), Fit (keep the shape at any scale), or Stretch (fill the screen). Mouse and touch are mapped in all three.