Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Coordinates/Mouse events are not rotated when the canvas is rotated in PIXI

$
0
0

Iam doing a game where i want to rotate the whole canvas to 90degrees for portrait version.

When i want to rotate the canvas, (app.renderer.view, this is how Pixi names canvas), I used the below code

app.renderer.view.style.transform = "rotate(90deg) translate(-190px,335px)"

Good thing is i can see the app rotated successfully. But the mouse or corordinate system still follows the landscape mouse coordinates.

I tried with many CSS and Pixi tricks. Nothing works. I tried with style.transformOrigin etc., in CSS. Does it anything involves that relate to PIXI code.

 


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>