SetOnGenTextModifierSub


SetOnGenTextModifierSub text, onTextModifier()

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

This particular event sub is the key to really good special effects. When you have a special effect in mind, like an explosion, you should break the effect down into a series of effects.



include "Game Engine Constants.inc"

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

SetOnGenTextModifierSub text, onTextModifier()

GenGrowText text, 1.5, 1.5, 5000

'...continue with program...

Sub onTextModifier(text, type)

if type = Mod_Grow_Complete then

GenSetTextRed text, rnd(100)
GenSetTextGreen text, rnd(100)
GenSettextBlue text, rnd(100)

endif

End Sub


text

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


type

This event sub is triggered by several different text 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_Grow_Complete = 4
Const Mod_Spin_Loop = 5
Const Mod_Spin_Complete = 6
Const Mod_Rotate_Complete = 7

SetOnGenTextModifierSub text, Off

Turns off the automatic subroutine call.


GenSetTextTimerA


GenSetTextTimerB


GenFadeText


GenGrowText


GenSpinText


GenRotateSprite


GenRotateSpriteTo


Game Engine Events


Event Triggered Subs






Become a Patron