FlatlandOptions
Defined in: packages/three-flatland/src/Flatland.ts:141
Options for creating a Flatland instance.
Properties
Section titled “Properties”aspect?
Section titled “aspect?”
optionalaspect?:number|"auto"
Defined in: packages/three-flatland/src/Flatland.ts:216
Fixed aspect ratio for the regular managed camera. When omitted or set to
'auto', Flatland derives the aspect from the renderer’s viewport (or the
render target) when its dimensions change. A PixelPerfectCamera
always follows the physical output shape so it can preserve integer
scaling; letterbox at the renderer or layout level to pin that shape. A
camera supplied through camera keeps its authored frustum. Calling
resize() takes full manual size control; assigning aspect = 'auto'
restores automatic sizing.
autoClear?
Section titled “autoClear?”
optionalautoClear?:boolean
Defined in: packages/three-flatland/src/Flatland.ts:190
Clear before direct rendering (default: true). Three’s post-processing scene pass always clears its private target so effects never sample stale frame data.
camera?
Section titled “camera?”
optionalcamera?:OrthographicCamera|null
Defined in: packages/three-flatland/src/Flatland.ts:168
Camera to use (null = use the internal orthographic camera). Flatland never rewrites a supplied camera’s frustum; its owner remains responsible for it.
clearAlpha?
Section titled “clearAlpha?”
optionalclearAlpha?:number
Defined in: packages/three-flatland/src/Flatland.ts:203
Background alpha (default: 1). Direct rendering and post-processing both preserve it, including offscreen targets. Fractional alpha uses clearColor; alpha 0 clears to transparent black to prevent RGB bleed when the result is filtered.
clearColor?
Section titled “clearColor?”
optionalclearColor?:ColorRepresentation
Defined in: packages/three-flatland/src/Flatland.ts:196
Background color used for Flatland-managed clears. A post-processing pipeline preserves an explicit Scene.background ; direct rendering retains Flatland’s historical managed-background behavior.
expectedSprites?
Section titled “expectedSprites?”
optionalexpectedSprites?:number
Defined in: packages/three-flatland/src/Flatland.ts:149
Advisory sprite count used to reserve the internal SpriteGroup’s hot
CPU-side storage. It never limits enrollment or pre-creates GPU batches.
React Three Fiber users pass a stable options object through args
(for example, one created with useMemo) and reconstruct Flatland to
change it; it is intentionally not a mutable JSX property.
optionalname?:string
Defined in: packages/three-flatland/src/Flatland.ts:156
Human-readable name shown in the devtools consumer UI. Useful to
distinguish multiple Flatland instances (e.g. name: 'main-game'
vs name: 'minimap') or a custom engine’s provider from the
default. Default: 'flatland'.
pixelPerfect?
Section titled “pixelPerfect?”
optionalpixelPerfect?:boolean
Defined in: packages/three-flatland/src/Flatland.ts:176
Use a managed PixelPerfectCamera when no custom camera is
supplied. The camera follows the physical drawing buffer or render target
and selects an integer world-to-pixel scale. This camera-only switch does
not change sprite or tile snapping; use FlatlandConfig or
RenderingConfig to change the rendering preset. Default: true.
postProcessing?
Section titled “postProcessing?”
optionalpostProcessing?:boolean
Defined in: packages/three-flatland/src/Flatland.ts:205
Enable post-processing pipeline (default: false)
renderTarget?
Section titled “renderTarget?”
optionalrenderTarget?:RenderTarget<Texture<unknown,TextureEventMap>,RenderTargetEventMap> |null
Defined in: packages/three-flatland/src/Flatland.ts:163
Render target (null = render to viewport). Targets with NoColorSpace default to sRGB; set LinearSRGBColorSpace explicitly for linear/HDR output. Pass the target before its first GPU use so Three allocates the matching attachment format.
viewSize?
Section titled “viewSize?”
optionalviewSize?:number
Defined in: packages/three-flatland/src/Flatland.ts:178
Orthographic view size in pixels (default: 400)
viewWidth?
Section titled “viewWidth?”
optionalviewWidth?:number
Defined in: packages/three-flatland/src/Flatland.ts:184
Optional fixed horizontal design extent for the managed pixel camera.
Together with viewSize, this enables exact letterbox/pillarbox framing.
Omit it to reveal additional world space and fill the available output.