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: Int
Target width. Affects window size at startup and affects screen scaling at any time. Ignored if set to 0 (default)
targetHeight: Int
Target height. Affects window size at startup and affects screen scaling at any time. Ignored if set to 0 (default)
windowWidth: Int
Target window width at startup
Uses targetWidth
as fallback if set to 0 (default)
windowHeight: Int
Target window height at startup
Uses targetHeight
as fallback if set to 0 (default)
targetDensity: Int
Target 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: Color
Background color.
Screen scaling (FIT, FILL, RESIZE, FIT_RESIZE).
title: String
App window title.
fullscreen: Bool
Fullscreen enabled or not.
targetFps: Int
Target FPS. Using default FPS if value < 1 or try to match the given value if >= 1.
maxDelta: Float
Maximum 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: Float
Override 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: Bool
If 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: Bool
If 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: ScreenOrientation
Setup screen orientation. Default is NONE
,
meaning nothing is enforced and project defaults will be used.
antialiasing: Int
Antialiasing value (0 means disabled).
appInfo: Dynamic
App info (useful when dynamically loaded, not needed otherwise).
resizable: Bool
Whether the window can be resized or not.
assetsPath: String
Assets path.
backend: Dynamic
Settings 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(): AutoCollections
App collections.
Returns |
---|
AutoCollections |
Private Members
settings: Settings
App settings
Name | Type |
---|---|
settings |
Settings |