graphics.toml
The graphics.toml file can be used to specify configuration related to graphics.
Simply create a file named graphics.toml, make sure it is in the root directory of your game's project,
and Easel will automatically load it.
Below is an example of a valid graphics.toml file, with all the default settings:
[graphics]
resolution = "max"
minResolution = "low"
cameraRadius = 50.0
aspectRatio = "auto"
bloomAlpha = 0.3
shadow = [0, 0.5]
Resolution
Easel can function at three resolutions: low, high, and max.
See Resolution to learn more about what these mean.
-
resolution: defines the initial resolution of your game. -
minResolution: defines the lowest resolution that your game can be set to, either automatically or manually.
Camera
The camera determines how the game-world coordinates are mapped to the pixels on the screen.
-
cameraRadius: defines the default radius of the camera. A single number defines both the vertical and horizontal radius at the same time. Specify an array of two numbers to define the vertical and horizontal radius separately, e.g.[100, 50]. -
aspectRatio: parameter defines the aspect ratio of the camera. The string value"auto"means that the aspect ratio will automatically match the aspect ratio of the game window. You can also specify a fixed aspect ratio using an Array in the format[16, 9]where the first number is the width and the second number is the height.
These values may be overridden at runtime using the Camera function.
Bloom
bloomAlpha: defines the default opacity of the bloom effect. This value can be overridden on a sprite-by-sprite basis using thebloomAlphaparameter, for example see PolygonSprite.
Shadow
shadow: defines the offset of the shadow in game-world coordinates. Specify as an array of two numbers, where the first number is the horizontal offset and the second number is the vertical offset, e.g.[0, 0.5].