image and video
Displaying an image or a video, and tinting them.
image (21 properties)
<image name="jaquette">
<pos>0.75 0.4</pos>
<origin>0.5 0.5</origin>
<maxSize>0.35 0.4</maxSize>
<path>${game.media.imagepath}</path>
<zIndex>30</zIndex>
</image>
| Property | Type | Role |
|---|---|---|
pos size origin rotation rotationOrigin | pair | placement |
maxSize | pair | maximum size without distortion — see Position, size |
keepratio | yes/no | keep the proportions (⚠️ all lowercase) |
path | path | the image file |
tile | yes/no | repeat the image as tiles instead of stretching it |
color | color | tints the image (multiplication) |
colorTop colorBottom colorLeft colorRight | color | gradient tint |
colorTopLeft colorTopRight colorBottomLeft colorBottomRight | color | four-corner tint |
reflection | pair | a reflection under the image: start and end opacity |
zIndex disabled | depth, switching off |
Formats
PNG, JPG and SVG. SVG is recommended for logos: it stays sharp at every size.
Image size
An image larger than the screen does not look better: the machine loads it whole into memory, then shrinks it to draw it. On a Raspberry Pi, a handful of 4000-pixel backgrounds is enough to slow the theme down.
The right measure is that of the largest screen you target: 1920 pixels across in high definition, 640 on a cathode-ray screen or a handheld console.
The studio takes care of it by itself: an image you drop is brought down to 1920 pixels if it exceeds that, vector drawings are cleaned up, and a theme that covers a cathode-ray screen also receives a reduced copy of its images, filed under assets/images-480/. The view files of those screens point to it.
tile — the repeated texture
<image name="grille">
<size>1 1</size>
<path>${root}/data/arts/motif.png</path>
<tile>true</tile>
</image>
The image keeps its original size and repeats to cover the box.
reflection
<reflection>0.5 0.0</reflection>
Adds a flipped reflection under the image, from 50% opacity at the top to 0% at the bottom.
video (15 properties)
<video name="md_video">
<pos>0.75 0.4</pos>
<origin>0.5 0.5</origin>
<maxSize>0.35 0.3</maxSize>
<delay>1500</delay>
<loops>0</loops>
</video>
Same placement properties as image, plus:
| Property | Type | Role |
|---|---|---|
delay | number | milliseconds before the video starts (1000 = one second); without delay, 2000 |
loops | number | number of plays; 0 = loop |
animations | text | the appearance effect |
link | text | tie the playback to another component |
reflection | pair | reflection, as on image |
video accepts neither tile nor the tint colors.
A
delayof1000to2000(one to two seconds) prevents the video from firing on every game merely passed through while scrolling the list.