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 679 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/d1173b75-32f1-4640-8de2-795c85bd472d.png" width="300" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

    注意:在“弹窗”模式中,只有当你点击弹窗上的“确定”之后,这个积木下面的代码积木才能运行。因此,如果你想让用户必须知悉一些东西然后才能继续,或者你想让用户首先阅读一些信息,就适合用弹窗消息。
     

    参数

    • 消息:你可以在这个输入框中填写任意内容,包括表情符号。
    • 弹窗:要在下拉菜单中选择“弹窗”。
    • 颜色:如果是弹窗消息,颜色将被忽略,因为所有弹窗消息都为黑色。

     

    在控制台打印消息

    控制台是游乐场底部的一个小窗口,在“背包”后面。打开、关闭方式如下:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/8f0649fd-653f-4bc0-b5cd-9107d5b4f62b.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">

    在控制台打印消息方法:在积木“打印”中选择“控制台”,还可以指定消息的颜色。当你打印一条新消息后,会显示一个红色的计数器提示你。

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/0421391b-13a0-4b01-95c4-73089d839fe0.gif" width="700" style="border-radius: 5px; border: 1px solid #29622d;">

     

    向下滚动控制台

    当你点击绿旗按钮之后,控制台中的所有消息都会被清空。如果控制台中有很多条消息,你可以向下滚动控制台以查看全部。还可以勾选确认框“自动滚屏”,那么控制台就会自动滚动到最新消息。

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/4b79b014-4f43-4c5b-8d14-c059215456f5.gif" width="700" 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