Hi! I badly needed a text tool to write numbers in realtime. Pen & "costume from text" tools didn't help. So I've made a replacement. Here is a sample project:
The idea is simple: there is a sprite with costumes representing digits from a font you like. This sprite has special block that creates clones of this sprite, placing them in right positions and setting their costumes to digits of the number you want to write. It is rather fast!
Update: You can now send commands (show, hide, move, set effect etc) to a particual text label with block
Nice! I was going to ask "What's wrong with WRITE?" until I saw that you want different digits different colors.
Two little bugs:
- The bounding box on the digit 1 costume is too close, so when you write the number 11111 you just see a solid block.
- You never initialize CURRENT X so the numbers start at x=0 regardless of the x input.
Not just different font & colors. Yes, it's good side effect. But the thing I need most is text labels, which I can update independently and fast. This scheme solves this task. If you call "WRITE NUMBER ... AT POINT..." block in the same point (x, y) several times, it will not print them on top of each other overlapping, but just update the existing text at this point and won't bother other text labels. It allows to work with several text labels, updating them when you need it.
The biggest problem with WRITE is that you can't update a particular text. You must call "clear all" and then redraw all the text labels.
- Yes, I'll add a space between digits, it's quite simple.
- Oh, thank you. Haven't noticed
Oh, I see. On the list for someday is multiple pentrails layers, which will take care of that for you. But I'm not promising when...
That would be a great feature!
Added "LabelID" for controlling particalar label and a block
for applying a command (show, hide, move, set effects etc) to a label with known LabelID. Test project now shows how to handle several labels independently.
It also would be great if we could draw pen on sprites, or can we? I haven't tried.
Not that I know of, but you could fake it with a small dot costume that you keep pasting as you move.