InitSettings
Same as Settings, but for app startup (inside Project.new(settings)). Read-only values can still be edited at that stage.
InitSettings provides write access to all application settings during the initialization phase. This includes settings that are normally read-only after startup, such as window dimensions, antialiasing, and backend configuration.
This class wraps the Settings instance and provides setters for properties that are immutable after initialization. It's only available in the Project constructor.
Example usage:
class Project extends App {
function new(settings:InitSettings) {
settings.targetWidth = 1920;
settings.targetHeight = 1080;
settings.windowWidth = 1280;
settings.windowHeight = 720;
settings.antialiasing = 4;
settings.title = "My Game";
super();
}
}
Instance Members
targetWidth: IntTarget width. Affects window size at startup and affects screen scaling at any time. Ignored if set to 0 (default)
targetHeight: IntTarget height. Affects window size at startup and affects screen scaling at any time. Ignored if set to 0 (default)
windowWidth: IntTarget window width at startup
Uses targetWidth as fallback if set to 0 (default)
windowHeight: IntTarget window height at startup
Uses targetHeight as fallback if set to 0 (default)
targetDensity: IntTarget density. Affects the quality of textures being loaded. Changing it at runtime will update texture quality if needed. Ignored if set to 0 (default)
background: ColorBackground color.
Screen scaling (FIT, FILL, RESIZE, FIT_RESIZE).
title: StringApp window title.
fullscreen: BoolFullscreen enabled or not.
targetFps: IntTarget FPS. Using default FPS if value < 1 or try to match the given value if >= 1.
maxDelta: FloatMaximum app update delta time.
During app update (at each frame), app.delta will be capped to maxDelta
if its value is above maxDelta.
If needed, use app.realDelta to get real elapsed time since last frame.
overrideDelta: FloatOverride app update delta time. This can be used to ignore completely the actual elapsed time between frames and replace it with an explicit delta time of your choice. This will affect timers, tween, systems update etc... Use with caution.
preventDefaultMouseWheel: BoolIf set to true (default). Default mouse wheel events
will be prevented. This is relevant when running the ceramic
app from an iframe inside a page that can scroll.
preventDefaultTouches: BoolIf set to true (default). Default touch events
will be prevented. This is relevant when running the ceramic
app from an iframe inside a page that can scroll,
on a touchscreen device.
orientation: ScreenOrientationSetup screen orientation. Default is NONE,
meaning nothing is enforced and project defaults will be used.
antialiasing: IntAntialiasing value (0 means disabled).
appInfo: DynamicApp info (useful when dynamically loaded, not needed otherwise).
resizable: BoolWhether the window can be resized or not.
assetsPath: StringAssets path.
backend: DynamicSettings passed to backend.
Default font asset
Default shader asset
Target width and height. Affects window size at startup and affects screen scaling at any time. Ignored if set to 0 (default)
| Name | Type | Description |
|---|---|---|
targetWidth |
Int | Target width |
targetHeight |
Int | Target height |
Target window width and height at startup
Uses targetWidth and targetHeight as fallback if set to 0 (default)
| Name | Type | Description |
|---|---|---|
windowWidth |
Int | Window width |
windowHeight |
Int | Window height |
collections(): AutoCollectionsApp collections.
| Returns |
|---|
| AutoCollections |
Private Members
settings: SettingsApp settings
| Name | Type |
|---|---|
settings |
Settings |