Should I scale the elements of my menus in my game with % or px (javascript, canvas oop game development)?

So, I'm currently developing a game with vanilla JS (and my libraries), using the JS canvas, of course. For menus, title screens, and the like, HTML elements are usually used.

For example, if I'm programming a start button for the title screen, should I do it with width: 100x … or width: 50% (of the canvas). I want it to look good on all screens, and I also want to publish it for mobile later (React?), so what's the best way to do this?

Mfg White Bread

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
2 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
RoadRage3
1 year ago

Hello Weissbrot965,

In percent, so that the corresponding elements responsive to the different screen sizes.

Ben