Placing an object in the top-left while maintaining responsiveness #3182
Unanswered
allennghayoui
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
Uh oh!
There was an error while loading. Please reload this page.
-
I am new to r3f and I would like to place a box on the top left of the screen without hard-coding position values because I need it to be responsive.
This is what I have with position={[0, 0, 0]} on the mesh:

I tried using the innerWidth and innerHeight properties of the window but when I do that the box goes completely off-screen.
I printed the innerWidth and innerHeight values they were 1699 and 575 respectively if that is useful.
This is my code:
Beta Was this translation helpful? Give feedback.
All reactions