Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player doesn't do <touching mouse-pointer> at non-default resolution #642

Closed
paulkaplan opened this issue Aug 23, 2017 · 3 comments · Fixed by scratchfoundation/scratch-vm#889

Comments

@paulkaplan
Copy link
Contributor

Expected Behavior

Please describe what should happen

This scratch project should work in the player:
mouse-tests

  1. follow mouse direction
  2. grow on mouse over
  3. change color on click

Actual Behavior

Describe what actually happens

(1) and (3) seem to work, but the boolean reporter <touching mouse-pointer> doesn't seem to work.

mouse-tests-player

It seems to be a scaling issue with the IO data sent to the VM when the player is at a non-native resolution, because it does grow at a different location (somewhere towards the bottom left).

Steps to Reproduce

Explain what someone needs to do in order to see what's described in Actual behavior above

Load up this project https://llk.github.io/scratch-gui/develop/player.html#171950733

Operating System and Browser

e.g. Mac OS 10.11.6 Safari 10.0

Screen width was at about 1200px wide when i made that gif.

@paulkaplan
Copy link
Contributor Author

@cwillisf I looked into this a bit and noticed that the ioData for the mouse is designed to be consumed in client coordinates, and so the mouse x/y reporters show the position in client coordinates. This is different from scratch 2, where the client coordinates are scaled to the renderer size before being consumed, so the reporters report the scaled position. That is, even at small (or big) renderer size, the mouse x is always [-240, 240]. Do we want to match the scratch 2 behavior here?

@thisandagain
Copy link
Contributor

That is, even at small (or big) renderer size, the mouse x is always [-240, 240]. Do we want to match the scratch 2 behavior here?

I think we most certainly want to match Scratch 2.0 (and prior) behavior and always scale coordinates to [-240,240] and [-180,180].

@thisandagain thisandagain added this to the Oct 18 milestone Aug 23, 2017
@thisandagain thisandagain modified the milestones: Oct 18, Dec 20 Sep 26, 2017
@thisandagain thisandagain modified the milestones: December, January Dec 21, 2017
@AmazingMech2418
Copy link

Maybe the touching block code needs to be revised. I would suggest using coordinates from the mouse or other sprite and the sprite vector rendering coordinates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants