Mintoris Forum

Author Topic: GEN003 More Text Effects  (Read 1460 times)


  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
GEN003 More Text Effects
« on: Jul 13, 2016, 11:58 PM »
The real power of the Game Engine effects comes from chaining effects together. This example builds on the GEN002 Text Effects.bas example. Instead of the text just spinning and shrinking, this example has the text oscillating between big and small while the text colors are always fading to a new random color.

Here is the text modifier event sub from the example.
Code: [Select]
' The following Event Sub is automatically triggered
' by a text effect event.
Sub onTextModifier(text, type)
  if type = Mod_Grow_Complete then
    if GenGetTextScale(text) < 1 then
      GenGrowText text, 2.0, 2000 + rnd(4000)
      GenGrowText text, 0.1, 2000 + rnd(4000)
    GenFadeText text, 50 + rnd(50), 50 + rnd(50), 50 + rnd(50), 100, 2000 + rnd(4000)
End Sub

Every time a text grow effect completes this event sub is called. If the text scale is less than one the text is made to grow, otherwise it is made to shrink. On every grow event complete the text color is made to fade to a new color.

How to override the action of the back button is also demonstrated in this example.

Code: [Select]
' Override the back button so the program will
' exit without a message box when the back
' button is pressed
SetOnBackButtonSub onBack()

Code: [Select]
' The Back Button event sub override
' Just exit
Sub onBack()
End Sub