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. 知识库
  3. 二维积木
  4. 通过标签控件简要介绍控件

通过标签控件简要介绍控件

Scheduled Pinned Locked Moved 二维积木
1 Posts 1 Posters 890 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.
  • C Offline
    C Offline
    creaticodeteacher2-mail
    wrote on last edited by admin
    #1

     

    先修科目

    • 积木——绿旗

     

    介绍

    控件是用于展示信息、获取用户输入内容的图形用户界面元素(例如标签或按钮)。既可以用在二维项目,又可以用在三维项目。

    我们接下来看看标签,作为第一个控件示例。标签常用于向用户展示一些信息。

     

    添加“控件”扩展

    添加“控件”扩展方法如下:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/5c1f25c6-a8d8-4f69-8f23-edb1a70e82df.gif" width="900" style="border-radius: 5px; border: 1px solid #29622d;">

     

    添加一个标签控件

    若要添加新的标签,可以用积木“添加标签”:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/7ab386b4-d913-4aae-a1b7-4f6eaf89093c.png" width="800" style="">

     

    参数

    • 标签显示文本:你可以在标签上写一些文字,也可以空白。
    • 中心位置:标签中心点的x坐标和y坐标。
    • 尺寸:标签的高和宽。注意,标签要小于舞台窗口大小,舞台窗口宽480,高360。
    • 控件名称:你添加的每一个控件都要赋予一个唯一名称,以便于之后用其名称引用它。如果你所用的名称已经被其他控件使用,首先会把那个控件删除。

     

    删除控件

    使用积木“删除名为( )的控件“可以删除任意控件:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/ea9bb904-f359-40b6-b6e3-267245f5b452.png" width="250" style="">
     

    参数

    • 控件名称:要从下拉列表中选择一个控件的名称。注意,为了给下拉列表填充数据,你要先运行添加控件的积木。

     

    范例

    在如下录屏中,我们先添加2个标签“开始标签”和“停止标签”,然后删除“停止标签”。注意,添加标签之前,积木“删除名为( )的控件“的下拉列表是空的。

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/80bfc854-28f9-48ff-95aa-98804a825a0d.gif" width="1000" style="border-radius: 5px; border: 1px solid #29622d;">

     

    删除所有控件

    有时你需要删除所有控件,就可以用这个积木:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/037365d1-1eab-4fee-8faf-ea64a8b1c487.png" width="200" style="">

    注意:当用户点击绿旗按钮后,所有控件都将被删除,所以,在项目最开始没必要用“删除本角色的所有控件”。

    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