This works by providing a dictionary/JS object instead of a string. The dictionary must have a “name” property, and may also have “width” and/or “height”; if only one dimension is specified, the texture is scaled proportionately. If neither is specified, they will default to the pixel dimensions of the image, which matches the old behaviour (unless your texture has a non-power-of-two size, in which case the behaviour now makes more sense).
The scaling works as follows: the Oolite display space is always 480 units high, while the width varies with the window’s aspect ratio. If the window is at a 4:3 aspect ratio, the width will be 640 units. If a background/overlay has dimensions specified as 640 by 480, it will fill up the screen.
The most common cases are likely to be:
- A higher-resolution version of your current background/overlay, with the same margins: use the dimensions of the old versions. For a full-screen backdrop, this will generally be width = 1024, height = 512 (or just height = 512).
- A proportionately scaled-up version of your current background/overlay with the margins trimmed: height = 480.
- An image scaled disproportionately to fit into a power-of-two aspect ratio (this is fiddly, but makes the best use of memory): the ideal dimensions of the image, scaled to a height of 480. For instance, for a 4:3 image, you’d use width = 640, height = 480. In this case, both dimensions must be specified.
- screenbackgrounds.plist
-
[url=http://wiki.alioth.net/index.php/Oolite_JavaScript_Reference:_Mission#runScreen]mission.runScreen()[/url]
-
setScreenBackground()
andsetScreenOverlay()
.
null
or ""
will remove any existing overlay/background, overriding screenbackgrounds.plist.