How to create a font scale animation.

If you have a menu that requires you to scale a font across an animation, here are 3 methods to do so. NOTE: Some of these methods may not be supported on more limited DeepScreen/hardware targets, so please submit a ticket to Altia Support before implementing one of these 3 methods.

NOTE: Use only one method below. It is not intended that you combine these methods:

1) Use Control code or C code to programmatically change the size of the font over time using the built-in animations altiaSetObj followed by altiaSetFont (altiaSetFont takes a UNIX style font string as a value). NOTE: This requires that you check the "Built-in Animations" checkbox when generating code. Also, you must have at least 1 example of each size of the font in the form of a Text I/O object somewhere in your dsn file. If you do not have on-screen text in each size that you will use with this method, simply put some text objects in a hidden card of a deck with the appropriate sizes. This is so the generated code will know to export the font at the right sizes for your code to be able to set the font accordingly.

2) Use a Deck for each menu item that has multiple Text I/Os on each card of each deck, and simply change the card of the Deck to achieve the "scale". NOTE: You don't necessarily need to make each card have a Text I/O at a different font size. You can instead keep all the Text I/Os the same font/size (which saves ROM/RAM), but simply change the dpi of the Text I/Os in each card using the Attributes->Advanced Font Settings area within Navigator.

Here is a simple example dsn showing the use of dpi settings for font scaling:

https://altia.zendesk.com/attachments/token/wNEdgtohOE2FSmfWYqzRk7thz/?name=font_scaling_with_dpi.dsn

3) Actually scale the text. NOTE: This requires the "Scale/Stretch affects Text" checkbox on the View ribbon to be checked in Altia Design. TIP: If you use this method, have the animation scale "down" vs. "up". That is, make the text "100%" size at its largest, and scale it smaller over the course of the animation. Scaled text quickly becomes "ugly" when scaled up/larger than its original size. Keep in mind that this method is not available on many/most miniGL targets, since it uses Scale.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.