Console live typing animation


I would like to create an animation with some random sentence written as was typed in a terminal shell, with also some rapid typo-deletions/corrections (so text is shown as typed lively corrections included).

Since the words should be random (dependent on user actions) I cannot prepare textures/sprites, so I was wondering what would be the best approach.

I was thinking to use AdvancedDynamicTexture, but I am not sure if it is the best approach or maybe I can use SpriteManager in someway (since text is shown in 2D.

Thank you.

AdvancedDynamicTexture or GUI would definitely be the way to go :slight_smile:

I’ve implemented a naïve working approach using TextBox, but I have one doubt and one issue:

  • Doubt: I have investigated a little TextBox class source code and it seems that is redrawing all text at each frame. Maybe I could create set of DynamicTexture for each word that is consolidated (it will not be deleted in my animation) and just using TextBox for the current word that is being typed.
  • Issue: TextBox seems to ignore horizontalAlignment and verticalAlignment property, so I have to use left and top property in a tricky way (compute half the canvas width and height and the subtract from actual position)

I think I will create a new post for a further doubt that I have about first point… Sorry, I am creating lot of posts, but I think/hope sharing doubts/questions could help also other people! :wink:

1 Like