ScratchData LogoScratchData
Back to geek62's profile

mouse/costume position test 2

GEgeek62•Created October 14, 2022
mouse/costume position test 2
0
0
9 views
View on Scratch

Instructions

This project is also meant to help understand the exact pixel positions of sprite costumes versus the mouse. Two obvious bugs are visible: (1) single-rectangle vector costumes which are one pixel wide or less are not shown at all. And (2) the 1x1 squares think they are ALWAYS touching the mouse pointer, even when it is nowhere close. (At some point the 20x1 rectangle was showing similar behavior, but now it is not. ...?) When the 20x20 square is showing, it thinks it is touching the mouse pointer when that has an x value between -19 and 1 inclusive, and a y value between -2 and 18 inclusive. So the area that the mouse pointer touches this rect is actually 21 pixels wide and tall. This could make sense, if the lines in the costume editor represented pixel centers rather than pixel edges. If this is true, then the 20x20 square costume actually completely covers a range of 19 pixels in X and Y, plus an additional 1/2 pixel on all sides. This would be neat, because then the center mark in the costume editor would actually be at the center of a pixel. But, if that were true, then the other project would not behave the way it does. It places four costumes in the quadrants around that center mark. If that was really the center of a pixel, then all four of those costumes would overlap part of that pixel, and the mouse at position (0,0) would touch all four of them. But it does not.

Description

#technical #sve #touchingMousePointer

Project Details

Project ID745422066
CreatedOctober 14, 2022
Last ModifiedOctober 26, 2022
SharedOctober 14, 2022
Visibilityvisible
CommentsAllowed