Link to home
Start Free TrialLog in
Avatar of James Hancock
James HancockFlag for United States of America

asked on

What is the correct strategy for coding the GUI of phone/tablet/browser games?

Hi
Probably an obvious question, but considering the differences between phones and tablets for javascript games..

... Is the proper way to do browser + device games' object locations in fractions of device height and width? And size game objects as ratios also? What must I do concerning strategies for phone/tablet+browser? AND device rotation accommodations?
How does Javascript detect phone / tablet/ browser?

I don't have a tablet. Which is the best to get for game dev? many ... iPad, Surface . . . not necessary, any?
Let's consider a word game like Wordscapes. The main interface is the circular  object to select letters for a word-answer. Is that just 1/4 of width distance from border and x% width for the circle diameter?
How different is it, really, on phone/tablet? What is the proper solution for all this?

Thanks
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

you query the viewport size https://ryanve.com/lab/dimensions/
Avatar of James Hancock

ASKER

Can this be used to determine the environment type? browser / phone / tablet? Specific device? Could I compare the width and height values to known device measurements, or is there a better way? What if it is a new device, with new dimensions I don't have waiting to compare to?

DO you think I should ground my object placement in pixels or fractions of the width/height?

Thanks
just scale your output for the viewport.  google responsive web app
you could use the useragent supplied by the browser (can be spoofed)
Do you mean window. width,. . height, etc? and locate game objects based on fractions of width and height?

What help would a Goog responsive web app provide?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Jackie Man
Jackie Man
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks all
Thanks