Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Free code for Tier 2: a class for Text Tweens

Author
Message
Jerry McGuire
7
Years of Service
User Offline
Joined: 25th Mar 2017
Location:
Posted: 7th Mar 2019 18:54 Edited at: 11th Mar 2019 19:59
Hi everyone,
I've been working with tweening for text lately. I thought I'd share the code I've written; hopefully it will prove useful for others:

The header file is TextTween.h :


And the implementation file is TextTween.cpp :
AppGameKit 2018.10.10

iMac Book Pro, MacOS 10.14, Xcode 10.1;
iPhone 6, iOS 12; iPad (3rd gen), iOS 9.35; iPad Pro 12'9 (2nd gen), iOS 12.

Dell Precision T7400, Windows 7 Professional 64bit, Visual Studio Community 2017;
Jerry McGuire
7
Years of Service
User Offline
Joined: 25th Mar 2017
Location:
Posted: 7th Mar 2019 19:09 Edited at: 11th Mar 2019 20:03
I spent quite a few hours on this. But with it you'll be able to do the following in the template.cpp file:



And you will have the message hello! do a 360 turn, have it's font increase from 10 to 30, and move 200 in the Y direction, taking one second for it. You can reduce the time it takes to do the turn, how many degrees, how long of a delay (I set 4 for this example), the font sizes, the amount moved in the Y direction...
This is how useful writing a class can be. You can reduce the lines of code from 5 to 2. And I am not using the other (setX, setAlpha, etc.) commands. All of them can be written on the same line. Reducing up to 12 lines into 2 lines!
Enjoy and let me know if you have trouble using it.
Cheers,
AppGameKit 2018.10.10

iMac Book Pro, MacOS 10.14, Xcode 10.1;
iPhone 6, iOS 12; iPad (3rd gen), iOS 9.35; iPad Pro 12'9 (2nd gen), iOS 12.

Dell Precision T7400, Windows 7 Professional 64bit, Visual Studio Community 2017;

Login to post a reply

Server time is: 2024-11-23 02:55:19
Your offset time is: 2024-11-23 02:55:19