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. Mouse X and Mouse Y

Mouse X and Mouse Y

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

    Introduction

    You can use these 2 reporter blocks in the sensing category to get the current position of the mouse pointer:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/ca89a7ca-f758-4cc3-8c80-75a3964690ca.png" width="350" style="border-radius: 5px; border: 1px solid #29622d;">

     

    As discussed in this article, the x position on the stage is always between -240 and 240, and the y position on the stage is always between -180 and 180.

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

     
    When you click on the “mouse x” block in the code editor, since the mouse has already past the left edge of the stage, the value will be the lower bound of the stage, which is -240:

    p.gif

     
     

    Say the Mouse Position Repeatedly

    You can use the following code to say the mouse position repeatedly in a forever loop:

    p.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