GenPanBackground


GenPanBackground background, PanToX, PanToY, msDuration

background

The background to Pan (scroll).

PanToX

The ending X position of the pan (scroll).

PanToY

The ending Y position of the pan (scroll).

msDuration

This is the duration of the Pan in milliseconds.

This command can be used to Pan (scroll) a background. The pan begins with the current background scroll position and pans to the specified X and Y position. The whole pan event is timed to take msDuration milliseconds. This command can be made to call a user defined Event subroutine upon completion.





include "Game Engine Constants.inc"

'...Turn on the game engine and init a background...

SetOnGenBackgroundModifierSub background, onBackgroundModifier()

GenPanBackground background, 150, 150, 5000

'...continue with program...

Sub onBackgroundModifier(background, type)

if type = Mod_Pan_Complete then

GenSetBackgroundRed rnd(100), background
GenSetBackgroundGreen rnd(100), background
GenSetbackgroundBlue rnd(100), background

endif

End Sub




SetOnGenBackgroundModifierSub


Game Engine Overview






Become a Patron