Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    鼠标的x坐标、y坐标

    二维积木
    1
    1
    182
    Loading More Posts
    • 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
      creaticodeteacher2-mail last edited by admin

      介绍

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

       

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

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

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

       
       

      重复说鼠标位置

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

      Animation2.gif

      1 Reply Last reply Reply Quote 0
      • First post
        Last post