GV Guy Posted October 31, 2022 Share Posted October 31, 2022 I've run into an issue with using click events with an adjusted resolution The event seems to trigger when you click where the sprite would be at 1.0 resolution rather than where the sprite actually is. I've reproduced using the examples here: https://pixijs.io/examples/#/sprite/texture-swap.js If I add the line: app.renderer.resolution = 0.5 Then the stage is shrunk to 50% size, but the click event is triggered when I click the middle of the canvas and not the actual sprite. Am I doing something wrong? Quote Link to comment Share on other sites More sharing options...
JoeMGomes Posted March 14, 2023 Share Posted March 14, 2023 I added the line you said right in the beginning like this const app = new PIXI.Application({ background: '#1099bb' }); document.body.appendChild(app.view); app.renderer.resolution = 0.5 And it worked like it should, the mouse is detected on the sprite and not on the centre of the canvas. Are you sure you did not change anything else? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.