Screen
Screen represents the area on which the app is rendered.
There are two screen sizes,
- render size: the raw resolution of the render buffer, which scales with device properties and quality settings. Notably, higher quality settings will use higher render resolution.
- points size: a fixed size that depends on device screen density. For this reason, this is generally used to create UI scenes that have a consistent look&feel accross devices.
In Blip, orthographic cameras automatically use points scaling, while perspective cameras use render scaling. This may become an opt-in for coders in the future, instead of being automatic.
As of version 0.1.1, the only exception to that rule is if an orthographic camera is forced to render before a perspective camera with Screen.ViewOrder, in which case, the orthographic camera will use render scaling. This may be addressed in future updates.
Functions
Captures a screenshot, ignoring the app UI. It will open a file picker to select a file location on your device.
You can optionally provide a default file name, and whether or not the background should be transparent.
Triggered when the Screen is resized. Passes the screen width and height in points as parameters.
Screen.DidResize = function(width, height) print("SCREEN SIZE:", width, height) end
Properties
Screen's density. This is the factor used for points scaling accross Blip.
You ordinarily shouldn't need to use this value, except for specific cases where elements need to manually be scaled to look consistent accross devices. Note that you do not need to use this when using an orthographic camera with the default projection size, since it will automatically enforce this scaling factor.
Screen orientation for mobile devices, one of all, landscape, or portrait. Can be set to lock the screen to the desired orientation.
Screen's render height, in pixels. This is the raw render resolution, which depends on device properties and quality settings.
Screen's size (width, height), in pixels.
Screen's render width, in pixels. This is the raw render resolution, which depends on device properties and quality settings.
Returns the margin on each side of the screen where, ideally, no UI element should be placed as they may overlap with some device features like a camera notch.
It is a table of four values using the following keys: Top, Bottom, Left, Right