BackgroundZBuffer = MyPicture_zbuffer;
property TransitionEffect = EFFECT_BLEND
This is the type of transition that is applied to the screen between scenes, when the enter-statement is executed. The game is not stopped during this transition, and objects still move and animate, events still get triggered, and scripts continue executing. The possible effects are listed below, and are defined in the standard script file Constants.s.
EFFECT_NONE | Has no special effect; the scene just blips from one to the next. |
EFFECT_BLEND | Blends the scenes together smoothly over several frames. |
EFFECT_FADE | Fades the old screen to black and the new screen from black. |
EFFECT_FADE_IN | Fades the screen in from black, without fading out first. |
EFFECT_FADE_OUT | Fades the screen out to black. |
EFFECT_BLANK | Blanking is just like fading, except to white instead of black. |
EFFECT_BLANK_IN | |
EFFECT_BLANK_OUT | |
EFFECT_BOX_IN | A shrinking-box effect starting from the edges of the screen, and moving inward to the middle. |
EFFECT_WIPE_UP | Wipe effects wipe across the screen from old to new. |
EFFECT_WIPE_DOWN | |
EFFECT_WIPE_LEFT | |
EFFECT_WIPE_RIGHT | |
EFFECT_SLIDE_UP | The old screen slides up, revealing the new. |
EFFECT_SLIDE_DOWN | |
EFFECT_SLIDE_LEFT | |
EFFECT_SLIDE_RIGHT | |
EFFECT_ZOOM_OUT | The old screen shrinks inwards. |
A related property, transitionTime, determines the number of cycles over which the effect is applied.
property TransitionTime = 24
This chooses the number of cycles in which the transition effect (decided by the transitionEffect property) is applied.
property ScrollX = 0
The offset of the background image from the right side of the screen. It is used to scroll the game space horizontally. ScrollX is reset to zero every time a new scene is entered.
Example
// pan from left to right
autoScroll = false; // set manual scrolling
scrollX = bgWidth - 640;
while scrollX > 0
{
scrollX = scrollX - 10;
delay;
}
property ScrollY = 0
The offset of the background image from the top of the screen. It is used to scroll the game space vertically. ScrollY is reset to zero every time a new scene is entered.
function BackgroundHeight
Gets the height of the current background image.
Returns
Height in pixels, or 0 if none exists.
function BackgroundWidth
Gets the width of the current background image.
Returns
Width in pixels, or 0 if none exists.
function StampZBufferRegion (zbuffer, x, y, transparencyMode, left, top, right, bottom)
Copies a section of a zbuffer onto a dynamic zbuffer.
Parameters
zbuffer | | The zbuffer to copy. |
x | | The x coordinate at which to stamp the zbuffer. |
y | | The y coordinate at which to stamp the zbuffer. |
transparencyMode | | Mode with which to stamp the zbuffer. (0: none, 1: all areas originally filled with black [priority 0] are transparent.) |
left | | Left x coordinate of the region of the zbuffer to stamp. |
top | | Top y coordinate of the region of the zbuffer to stamp. |
right | | Right x coordinate of the region of the zbuffer to stamp. |
bottom | | Bottom y coordinate of the region of the zbuffer to stamp. |
See Also...