skip to content
Orx Learning
User Tools
Admin
Log In
Site Tools
Search
Tools
Show page
Old revisions
Export to PDF
Backlinks
Recent Changes
Media Manager
Sitemap
Log In
>
Recent Changes
Media Manager
Sitemap
Trace:
Welcome
Beginner's Guide
Config
Examples
Tutorials
en:tutorials:animation:text_animation
====== Text Animation ====== Not only can the animation system work with graphics and frames, it can also animate text strings. Think "Ready Set Go" in racing games or animated text in console games (rogue-likes!). To start this tutorial, let's [[en:tutorials:projects:creating_your_own_project|create a blank project using the init script]]. In the config file, remove the default ''[Object]'' section and everything below it. Paste in the new CountDown object and animation set: <code ini> [CountDown] AnimationSet = CountDownAnimationSet [CountDownAnimationSet] Pivot = center Text = @ ; Look in the current section for Text properties, like String. (But no string defined, so starts blank) StartAnim = Ready Ready = 0 Count = 0 ;Count animation uses 0, meaning as many frames as defined in config by convention: Count1, Count2, etc. Go = 0 Ready-> = Count Count-> = Go </code> In the code, change the default ''Object'' creation to our ''CountDown'' object: <code c> orxObject_CreateFromConfig("CountDown"); </code> If you're not familiar with the animation system, be sure to have a look at the [[en:tutorials:animation:animation_walkthrough|Animation Walk-through]]. To explain the above, we start with an object called ''CountDown''. The object is empty and only has an animation set which will perform changes on itself. In the animation set, there are three animation names defined: * Ready * Count * Go In addition to defining the animation names, we show what happens when one animation ends and where another begins. ''Ready'' is first, second is ''Count'', and finally ''Go'' which loops forever. Now to make the animation frames and timings using numbered convention: <code ini> [Ready1] String = READY! KeyDuration = 2 [Count] KeyDuration = 0.5 [Count1] String = 3 [Count2] String = 2 [Count3] String = 1 [Go] KeyDuration = 0.25 [Go1] String = GO [Go2] String = >GO< [Go3] String = >>GO<< [Go4] String = >>>GO<<< [Go5] String = >>GO<< [Go6] String = >GO< </code> To explain the above, ''Ready1'' is the first frame of ''Ready''. It is held for 2 seconds, and shows ''READY!'' during that time. Once expired, it moves to ''Count1'' to ''Count3'', using ''Count'' to get common properties like the duration of each frame. Finally the ''Go'' animation plays.
en/tutorials/animation/text_animation.txt
ยท Last modified: 2025/09/30 17:26 (14 months ago) by
127.0.0.1
Page Tools
Show page
Old revisions
Backlinks
Export to PDF
Rename Page
Back to top