-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
How to check if the container inside pixi-viewport contains a point returned by the "on wheel" event? #465
Comments
There is no simple way to do that, since viewport just firest the event that way. You can copy the source code of a wheel plugin and add custom parameters in every place where the event is fired. Why would you need to do that at all? |
I used 2 event listeners one wheel event, and zoomed event. The first one returns mouse position, then I story it in a variable and I have a access to that variable in zoomed event. I want to do something like zoom-in image which is in lower resolution, then when scale is reached I want to change view with selected image in higher resolution. |
But why would you need to check if the pointer is inside of an image? Why cant you just check if the image is still visible in viewport? You just need to check if viewport's current rectangle intersects image's rectangle |
When I use "zoomed" listener it returns only "type" and "viewport". How can I get information about pointer position?
![image](https://private-user-images.githubusercontent.com/47736308/270972255-cc777bf4-a67d-4fef-8bb0-375d3cac8e63.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4MTM1MDUsIm5iZiI6MTcxODgxMzIwNSwicGF0aCI6Ii80NzczNjMwOC8yNzA5NzIyNTUtY2M3NzdiZjQtYTY3ZC00ZmVmLThiYjAtMzc1ZDNjYWM4ZTYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE5VDE2MDY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE3MmI3NzI2YWFjZTY5Yjg4OTFlNmY3N2JkNDcxZTBhMjg0ZWE1YjlhZDM2NzgxNDIzYTg5OTEzODFiY2E2MzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ik2d67pMfEFYnvzVBtqQIlmYbi65NDTMViQQQBIeTXY)
The text was updated successfully, but these errors were encountered: