hey, so when I set a virtualWidth/virtualHeight (d...
# korge
n
hey, so when I set a virtualWidth/virtualHeight (differently from the native width/height), it seems like
Copy code
playArea.hitTest(mouseXY)
(playArea is a
roundRect
) no longer works correctly.
Copy code
playArea.hitTest(playArea.localMouseXY(views))
also doesn't work. what's the incantation I'm missing?
alright, I figured it out. 1. View.hitTest says it requires local coords, but in fact requires global coords 2.
mouseXY
, aka
Stage.mouseXY
, return coords relative to the Stage (seems obvious now...) 3.
views.input.mouse
is undocumented but seems to return global coords. 4.
playArea.hitTest(views.input.mouse)
is the answer.
d
Yeah thats a bit misleading. We have to figure out a way to make it less confusing. If you have suggestions in that direction, let us know
n
I think checking that hitTest's documentation is correct, and having `mouseXY`'s and `views.input.mouse`'s documentation reference each other, that would be sufficient. (or renaming mouse to localMouse/globalMouse, but obviously we can't do that)
d
Well since we are working on korge 2.0 now and compatibility breaking is allowed, we can make those renames if makes more sense