You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you adjust the renderer resolution click events on sprite should still work when you click the sprite
Current Behavior
When you adjust the renderer resolution click events fire when you click the possition the sprite would be if the resolution was 1
Possible Solution
?
Steps to Reproduce
Create a PIXI App
set the
renderer.resolution = 0.5
Add a sprite to stage
Add click event on sprite
Click sprite - Event does not fire
Click where sprite would be at 100% resolution - Event Fires
Environment
pixi.js version: 6.5.8
Browser & Version: Chrome 107
OS & Version: Windows 10
Running Example:
const app = new PIXI.Application();
document.body.appendChild(app.view);
app.renderer.resolution = 0.5
let bol = false;
// create a texture from an image path
const texture = PIXI.Texture.from('examples/assets/flowerTop.png');
// create a second texture
const secondTexture = PIXI.Texture.from('examples/assets/eggHead.png');
// create a new Sprite using the texture
const dude = new PIXI.Sprite(texture);
// center the sprites anchor point
dude.anchor.set(0.5);
// move the sprite to the center of the screen
dude.x = app.screen.width / 2;
dude.y = app.screen.height / 2;
app.stage.addChild(dude);
// make the sprite interactive
dude.interactive = true;
dude.buttonMode = true;
dude.on('pointertap', () => {
bol = !bol;
if (bol) {
dude.texture = secondTexture;
} else {
dude.texture = texture;
}
});
app.ticker.add(() => {
// just for fun, let's rotate mr rabbit a little
dude.rotation += 0.1;
});
The text was updated successfully, but these errors were encountered:
Used to be able to set the resolution of the old InteractionManager - something I was doing along with setting the renderer's resolution upon resize, to detect changes to the viewport size as well as the page being zoomed in and the devicePixelRatio changing.
Just figured out I can set app.renderer._view.resolution to get back the ability to change the resolution on the fly, but no way to do so for the new events system unfortunately.
Expected Behavior
When you adjust the renderer resolution click events on sprite should still work when you click the sprite
Current Behavior
When you adjust the renderer resolution click events fire when you click the possition the sprite would be if the resolution was 1
Possible Solution
?
Steps to Reproduce
Create a PIXI App
set the
renderer.resolution = 0.5
Add a sprite to stage
Add click event on sprite
Click sprite - Event does not fire
Click where sprite would be at 100% resolution - Event Fires
Environment
pixi.js
version: 6.5.8The text was updated successfully, but these errors were encountered: