Navigation

    CreatiCode Scratch

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Printing Text on Stage

    2D Blocks
    1
    1
    25
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by info-creaticode

      Introduction

      In MIT Scratch, to display any text on the stage window, you have to add text to the costumes. On the CreatiCode playground, you can easily print any text using the “print text” blocks.

       
       

      The “Print” Block

      You can find the “print” block in the Looks category.

       

      Parameters

      • Text to Print: any text you want to be printed on the window. Note that they will all be printed in one row.

      • Center Position: the x and y positions of the center of the text. For example, if both x and y are 0, then the text’s center will be at the player window’s center.

      • Bounding Box Size: the width and height inputs determine the size of the text. The text should not be wider than this width, and also not taller than this height. Most of the time, only one of these 2 constraints will be in effect. For example, if you use a really large number for width, then the final size of the text will depend on the value of the height.

      • Color: You can set the color of the text, even with some transparency.

       
       

      Demo

      In this program, we are printing 2 lines of text of different sizes, with the “Hello” in semi-transparent color:

       
       

      Print for Some Time

      You can use another similar “print” block to print some text just for a while then clear it automatically:

      You just need to specify the number of seconds for the text to say as the last input.

       
       

      Clearing the Text

      Whenever you click the green flag button, all prints will be cleared automatically. However, if you want to clear the printed text during a program’s run, you can use one of these 2 blocks:

      This block will remove all the text printed from the current sprite.

      This block will remove all the text printed from any sprite in the project.

       
       

      Demo

      This program will print the value of the timer every second, and clear the previous print as well.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post