Step 4: Improving the text

Click Edit in the top-right corner to return to editing the script.

First we'll position the text correctly, then we'll use a few text formatting blocks to make the text look nicer.

Grab "set x position of myself" (from Transform), "instance textfield" (from Variables), "_+_" (from Operators), and "x position of myself" (from Transform). Connect them together as shown below (click on the image below to make it bigger).

Change the 0 to 65.

If you play the game now, you'll see the text has been pushed across. We also need to push it down.

Right-click on the "set x position of" block, and select duplicate.

Change the duplicate blocks from "x position" to "y position".

Now we'll make the text look nicer. From the Draw tab, grab "Set font size", "Set font colour", "Set font family", and another "Set font size" block. Drag these four blocks underneath the "set y position" block.

Change the fourth block from "Set font size" to "Set max width" by clicking on "font size".

Change the number for max width to 550, then click Play.

Looking good! You can click on the font size number, the font colour, and the font family to change how the font looks.

Lastly, we'll create a variable to keep track of the page number, and we'll set the textfield as a variable as well. Go to the Properties section of Variables, grab two "Set true/false i to" blocks, and drag them beneath the previous blocks.

Click on the first i, and select Create New. Name this variable "page number".

Then click on true/false and change this to number.

Then drag a number block into the gap in this variable block, and set it to 1.

That will make this variable remember this as page 1.

Now with the second variable block, we'll create a new one named "story textfield". Set its type as "instance".

Lastly, drag "instance textfield" (from the Local section of Variables) into the gap.

results matching ""

    No results matching ""