GXBackgroundAdd - boxgaming/gx GitHub Wiki

Syntax

GXBackgroundAdd imageFilename$, mode&

Description

Adds a new background image to the current scene. Multiple background images may be added to the scene. Background images are displayed in layers based on the order they are added. One of the following modes must be specified:

Mode Description
GXBG_STRETCH Stretch the background image to the size of the scene.
GXBG_SCROLL Fit the height of the background image to the size of the screen. Scroll the horizontal position relative to the position on the map.
GXBG_WRAP Continuously wrap the background as the scene is moved horizontally.

Examples

Example1: Add a background to the scene. The image of the mountain will appear fixed in the background. The trees will move slowly relative to the map position.

GXSceneCreate 320, 200
GXBackgroundAdd "mountain.png", GXBG_STRETCH
GXBackgroundAdd "trees.png", GXBG_SCROLL

See Also

GXBackgroundClear