What's the correct approach for handling renderer width and height when resolution is not 1
?
#9943
Unanswered
gabrielecirulli
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a simple scenario: I'm setting up a canvas to render on a retina screen. That means its
resolution
is2
.When I query
app.renderer.width
orheight
, I get a value that is scaled by the resolution. For example, if I set up my application withwidth
andheight
of800
and600
respectively, I would get back1600
and1200
.I found this surprising, as I would've expected these values to remain resolution-independent. I understand the reasoning, as the underlying canvas does have that specific underlying resolution, but my question is, is there a utility method or attribute that's automatically scaled back by the resolution, or must I build such a utility method myself?
I wasn't able to find an answer to this by googling.
Beta Was this translation helpful? Give feedback.
All reactions