Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

CameraProps

Property Type Default value Description
bodyNearEye? BodyNearEye BodyNearEye.Fade What the camera does with her body when the eye comes within 0.35 m of it: fade her through a dither and keep her shadow, hide her, or leave her drawn.
clickToWalk? boolean undefined Whether a click on the ground walks her there.
distance? number undefined Metres from her the eye starts at, within the zoom’s stops; the wheel moves it from there. Left out, the eye starts where the last scene’s camera stood, within the stops, or the preset’s start.
eyeHeightFraction? number 0.78 How far up her height the aim sits when the eye is at the near stop, as a fraction of her measured height, so one value frames every avatar alike; far out, the aim slides to her middle.
fieldOfView? number 80, and 102 in the shooter preset Degrees the camera sees across a 16:9 screen, until the player sets their own Field of view. A wider screen keeps that height and sees more at the sides; a screen held upright sees the figure top to bottom at 9:16.
firstPerson? boolean undefined Whether a wheel notch in at the near stop puts the eye in her head.
firstPersonMaxPolarAngle? number MathUtils.degToRad(179), 89 degrees up maxPolarAngle in first person, where the eye looks further up. Short of 180: at the pole the eye’s sideways direction is undefined and a turn spins the view.
firstPersonMinPolarAngle? number MathUtils.degToRad(1), 89 degrees down minPolarAngle in first person, where the eye looks further down with no body below it to frame.
fixedFieldOfView? boolean undefined Whether the camera keeps fieldOfView whatever the player sets, for a design that needs one lens. Leave it off where you can: a view that suits the player’s screen and how far they sit from it eases motion sickness, which is why the accessibility guidelines ask for the setting.
follow? ViewTarget | null CameraTarget.ViewTarget What the camera keeps in frame: the player unless told otherwise; null is a free orbit the player drags, for a menu.
freeCursorKey? string undefined The key, as a KeyboardEvent.code such as "AltLeft", that frees the cursor while the player holds it, so she can click the HUD without leaving play, as an MMO’s cursor key does; letting it go takes the lock back. A hold rather than a toggle: letting go can never leave her stuck with a free cursor in a shooter. A game that wants a toggle calls useFreeCursor from its own key. Windowed Firefox grants no lock without a click, so there the menu’s Play takes it back. No key unless set, and no preset sets one.
lockToggle? boolean undefined Whether Shift turns the lock on and off.
lookSpeed? number (2 * Math.PI) / 1600 Radians a pixel of mouse travel turns the camera while the cursor is captured, before the player’s mouse sensitivity multiplies it.
maxDistance? number 9 The farthest the wheel takes the eye, in metres.
maxFieldOfView? number 120 The widest the player’s Field of view goes in this game.
maxPolarAngle? number MathUtils.degToRad(170), 80 degrees up The lowest the eye drops below her, in radians from straight up: 90 degrees plus how far up the player may look. A smaller value is a tighter stop, such as MathUtils.degToRad(90 + 60) for 60 up.
minDistance? number 0.7 The nearest the wheel brings the eye in third person, in metres.
minFieldOfView? number 60 The narrowest the player’s Field of view goes in this game.
minPolarAngle? number MathUtils.degToRad(10), 80 degrees down The highest the eye rises above her, in radians from straight up: 90 degrees less how far down the player may look. A larger value is a tighter stop.
pitch? number undefined Degrees the eye starts looking down, negative up, within the tilt’s stops. Left out, the eye keeps the tilt the last scene’s camera left, or the preset’s start.
pivotRise? number 0 Metres above her eyes the aim rises while the lock is on.
preset? CameraPreset CameraPreset.Default The knobs a knob left out takes.
rememberFraming? boolean false: each load starts behind her Keeps where the player left the camera on this device, under the game’s name, and puts it back as the camera mounts: its turn, tilt and distance. A view setting, never part of the player’s save.
shoulderOffset? number 0.49 Metres right of her the aim moves while the lock is on, so the middle of the screen clears her; negative is her left.
startLocked? boolean undefined Whether the lock is on from the start: the cursor is captured from the first click on Play.