Step 2: Blit the Characters
This event differs from the blitting event in the last tutorial. If you remember correctly, last time we used an alterable value named CurrentPosition to keep track of which character we were currently blitting. This time, since each character is created on a different loop, we can simply refer to the Loop Index. Note that the first loop has a loop index of 0.Another difference is that we are retrieving the current character in the same expression that searches CharSheet. Instead of retrieving it, storing it in an alterable string, and then retrieving it again when we search CharSheet as we did in the previous tutorial. This way is quicker, only a little hard to follow.
Please, create the following event:
- On loop "Blit"
: Create
at 0,0 from 
: Force animation frame to Find(CharSheet( "
" ), Mid$(Text( "
" ), LoopIndex("Blit"), 1), 0)
: Set ID to Find(CharSheet( "
" ), Mid$(Text( "
" ), LoopIndex("Blit"), 1), 0)
: Set Line ID to Blit Line ( "
" )
: Set X Position to X Right( "
" )
The force animation frame expression is very similiar to the expression we used in the previous tutorial, but just to make sure you're still following, we'll run through it.
To isolate the current character, we use the Mid$ function, which requires the following 3 parameters.
| Parameter | Description | In our case... |
|---|---|---|
| String | The string from which characters are returned. | |
| Start | Specifies the starting position. | |
| Length | Specifies the number of characters to return. |
So,
Then we use the Find function to retrieve the numeric position of the CurrentCharacter within the CharSheet. It also requires 3 parameters:
| Parameter | Description | In our case... |
|---|---|---|
| String | The larger string you are searching. | |
| Query | The smaller string you are searching for. | |
| Start | Specifies the starting position. |
We will also store this same value in the ID alterable value of each Character object. Once again, remember the order of actions is important. The action which moves the Blitter object must be after the action which forces the animation, otherwise the Blitter will not be moved to the correct spot.
5