-
Notifications
You must be signed in to change notification settings - Fork 339
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
"Is Touching" behavior can be different on devices with different pixel densities/after going to full screen and back #656
Comments
@fsih Do you have an idea of which types of devices have undesirable behavior? We're trying to get an idea of impact. |
@BryceLTaylor we think that all devices should probably act as if isTouching and isTouchingColor are being run on a 480x360 sized project screen. In that case the devices with device pixel ratio = 1, at normal screen size, are the only ones doing the right thing right now (the cat does not say hello in the touching bread project) and all higher dpi devices, and any device that has been put into fullscreen mode, or was previously in fullscreen mode, is doing the wrong thing (the cat says hello as it passes the bread) What's the right behavior is up to us to decide though. If you can see some of the pixels of the cat touching the bread when it's at full screen, but not when it's in normal screen size mode, should the cat always say it's touching the bread, even if it means projects behave differently on different devices? |
IIRC we actually figured out that the cat should always count as touching the bread (at least, it does on my branch), but somehow does not currently. At the very least it should count as touching the bread when you use the "touching sprite" block |
I am all for deterministic is touching :) - Good move!
…On Thu, 9 Jul 2020 at 22:00, DD Liu ***@***.***> wrote:
@BryceLTaylor <https://github.com/BryceLTaylor> we think that all devices
should probably act as if isTouching and isTouchingColor are being run on a
480x360 sized project screen. In that case the devices with device pixel
ratio = 1, at normal screen size, are the only ones doing the right thing
right now (the cat does not say hello in the touching bread project) and
all higher dpi devices, and any device that has been put into fullscreen
mode, or was previously in fullscreen mode, is doing the wrong thing (the
cat says hello as it passes the bread)
What's the right behavior is up to us to decide though. If you can see
some of the pixels of the cat touching the bread when it's at full screen,
but not when it's in normal screen size mode, should the cat *always* say
it's touching the bread, even if it means projects behave differently on
different devices?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#656 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTM3PWJVH73F35N7HRXV3TR2YVVZANCNFSM4OV545HQ>
.
|
@adroitwhiz's branch is fixing some issues with isTouching, but I think with the isTouching code as it is now, we want everything to match the case on a 1:1 device pixel ratio with normal sized screen case, where the cat doesn't touch the bread |
Would it be viable to refactor the collision algorithm to transfer the drawable to a 480x360 non-displaying canvas element that is used specifically for the collision algorithms? Canvas size in pixels is clearly the issue here, and of course, it would not be ideal to change the entire rendering system to use only 480x360 since it would ruin image quality, but for collision detection, it might work. Not sure on the impacts on performance though... But all that would be needed is to transfer the drawable to a 480x360 canvas and then use that canvas to determine if the drawable is touching each point. |
This is the issue seen in #432, but the PR that was reverted did not fix the issue.
Expected Behavior
Load https://scratch.mit.edu/projects/409952654/editor/ on many devices
All devices should have the same behavior
Actual Behavior
Some of the devices say hello when you play the project, some don't
Steps to Reproduce
Load https://scratch.mit.edu/projects/409952654/editor/ and press the green flag
in particular, my mac 15" mid 2015 version (battery explosion version) says hello
chris's windows 10 chrome with device pixel ratio 1 does not say hello. If he goes fullscreen and runs it, then it says hello.
Operating System and Browser
e.g. Mac OS 10.11.6 Safari 10.0
The text was updated successfully, but these errors were encountered: