AppConfig class App
The configuration settings for the application.
This class holds various parameters that can be used to initialize and customize the application's behavior.
class MyGame extends App {
}
void main() {
AppConfig config = AppConfig(
// Sets the CSS Selector to get the canvas element that the app should
// use to render itself
canvasElement: "#cssSelectorOfTheCanvas",
// You can increase the memory that is used for the renderer to bacht
// draw calls. If it is too small, it commits the queued calls to the
// GPU and logs a warning message to the developer console.
// In thise case you can improve the reserved memory here, to optimize
// youre rendering performance.
gfxBatchCapacityInBytes: 65536,
// By default, if your app looses focus it stops running. You can disable
// that, so your app continues to run even if it looses focus.
autoSuspend: false
// On iOS you need to rquest permission from the user to use the Gyroscope. If you
// set this to true, it will be handled automatically for you on the first user
// interaction (click).
autoRequestAccelerometerPermission: false
);
// Create an instance of you application with the desired configuration
// and run the app.
MyGame(config);
}
Constructors
Properties
- autoRequestAccelerometerPermission ↔ bool
-
If set to true, it automatically requests the permission from the user to read out
the accelerometer.
getter/setter pair
- autoSuspend ↔ bool
-
Indicates whether the application should automatically suspend its operations
when it is not active (e.g., when the browser tab loses focus).
getter/setter pair
- canvasElement ↔ String
-
The CSS selector for the HTML canvas element where the application will be rendered.
getter/setter pair
- gfxBatchCapacityInBytes ↔ int
-
The capacity of the graphics batcher in bytes.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited