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. 鼠标的x坐标、y坐标

鼠标的x坐标、y坐标

Scheduled Pinned Locked Moved 二维积木
1 Posts 1 Posters 677 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

    介绍

    可以用侦测类别的如下2个报表积木获取鼠标指针的当前位置:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/8e028497-581f-45dc-bdb0-ac4fc1e7dda1.png" width="450" style="border-radius: 5px; border: 1px solid #29622d;">

     

    在这篇文章已经提到,舞台上的x坐标介于-240和240之间,y坐标介于-180和180之间。

    3cb12307-022d-43a5-a4b0-9427f70dd1d5-image.png

     
    当你点击代码编辑器中的积木“鼠标的x坐标”,由于鼠标已经超出舞台边缘,其值就是舞台的下限,即-240:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/e04f0045-2e67-4399-a1ee-bff70907aba0.gif" width="650" style="border-radius: 5px; border: 1px solid #29622d;">

     
     

    重复说鼠标位置

    可以用如下代码在一个“重复执行”循环中重复说鼠标位置:

    Animation2.gif

    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