I'm trying to change the overall dimensions of my app. It reads 360x640. My canvas is 4x larger in DPI thus giving me 1440x2560 using window.screen.width
.
There is a method to use window.screen.width
to define a canvas, but I'm trying to change the value of window.innerWidth
& window.innderHeight
.
Main problem I'm facing is when I drag an element, it moves 1pixel per 4pixel of my touchmove because the app's width itself is 360, and the canvas is 1440, thus moving 1px on the device, per 4px of my touchmove. Even though I achieve a 60fps drag, if you look closely, it gives the drag a kind of block moving effect, rather than being smooth.
I'm not sure but I think this was solved with defining viewport
in html by target-densitydpi=device-dpi
, but this has been deprecated.
I think what I need is a way to make the window.innerWidth be equal to window.screen.width, is this possible?
window.innerWidth == 360px //Can I change these values?
window.innerHeight == 640px //Can I change these values?
window.screen.width == 1440px
window.scree.height == 2560px
P.S If question unclear, don't hesitate to ask away!