Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 2D Blocks
  4. Printing Text on Stage

Printing Text on Stage

Scheduled Pinned Locked Moved 2D Blocks
1 Posts 1 Posters 1.1k Views
  • 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.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

    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.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/dbf25107-64c0-4b67-b691-819d48420619.png" width="500" style="">

     

    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:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/7b5ced49-416e-4c28-91fb-6426ab121e24.png" width="600" style="">

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/410c518d-300b-4c60-adea-1718b103d264.png" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

     
     

    Print for Some Time

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

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/9f2ed125-15f2-4a86-81b5-3ea15808942d.png" width="600" style="">

    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:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/360d5bf1-ee13-4231-8716-0f9c7d8bfcf7.png" width="200" style="">

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

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/09849753-583e-4bf7-ac3e-b2232285ba09.png" width="170" style="">

    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.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/3a3f5a30-1fb7-436b-9223-2f820e766223.png" width="500" style="">

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/2dabb268-aae6-425d-ab77-dcbe54ece9cc.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode