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. Setting Text on Widget

Setting Text on Widget

Scheduled Pinned Locked Moved 2D Blocks
1 Posts 1 Posters 858 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 Online
    CreatiCodeI Online
    CreatiCode
    wrote on last edited by admin
    #1

     

    Prerequisite

    • The Label Widget

     

    Description

    You can change the text written on any widget using the 2 blocks introduced below.

     

    Setting Text Directly

    This block allows you to set the value of any widget. Note that the “value” may mean different things for different types of widgets. For a label, its value is just the text on it, so when we set a new value for a label widget, it will replace the existing text on that label:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/a5f8ac14-08f0-4ae4-a229-04681b7b19f6.png" width="400" style="">

     

    Parameters

    • New Value: The new value you want to set for the widget (such as a label)
    • Widget name: You need to select which widget you want to change. That widget has to be added to the stage already for its name to show up in this list.

     

    Appending Text After Existing Text

    This block allows you to keep the existing text written in any widget, and append new text after it:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/07a72373-8dc4-485f-a951-cc308d442302.png" width="500" style="">

     

    Parameters

    • Text to Append: Text string to be appended.
    • Widget name: You need to select which widget you want to change. That widget has to be added to the stage already for its name to show up in this list.

     

    Demo

    This screencast shows how to use these 2 blocks to update the text on a label. Note that when you append new text, you may need to start with a SPACE letter.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/b393b875-e85d-459a-af0b-c3603254bd68.gif" width="1000" style="border-radius: 5px; border: 1px solid #29622d;">

    1 Reply Last reply
    0
    • CreatiCodeI CreatiCode pinned this topic on

    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