SetOnGenBackgroundModifierSub


SetOnGenBackgroundModifierSub background, onBackgroundModifier()

Sets the on background modifier subroutine for the specified background. Once set, the specified onBackgroundModifier() subroutine will be automatically called when background effects complete.



include "Game Engine Constants.inc"

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

SetOnGenBackgroundModifierSub background, onBackgroundModifier()

GenZoomBackground background, 150, 150, 5000

'...continue with program...

Sub onBackgroundModifier(background, type)

if type = Mod_Zoom_Complete then

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

endif

End Sub


background

The Game Engine background object. This is the background that triggered the event sub.


type

This event sub is triggered by several different background effect events. The type parameter tells you what effect triggered the sub call.

From the Game Engine Constants.inc file. This include file is located in the global include directory and may be used by any Basic program.

' Modifier event sub types
Const Mod_TimerA = 1
Const Mod_TimerB = 2
Const Mod_Fade_Complete = 3
Const Mod_Zoom_Complete = 4
Const Mod_Spin_Loop = 5
Const Mod_Spin_Complete = 6
Const Mod_Rotate_Complete = 7
Const Mod_Pan_Complete = 8

SetOnGenBackgroundModifierSub background, Off

Turns off the automatic subroutine call.


GenSetBackgroundTimerA


GenSetBackgroundTimerB


GenFadeBackground


GenZoomBackground


GenSpinBackground


GenRotateBackground


GenRotateBackgroundTo


Game Engine Events


Event Triggered Subs






Become a Patron