You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am making a game with bevy and egui. I convert the game to wasm using wasm-bindgen to play it on a browser.
However, it doesn't look clean since the egui panels always fill out the whole screen, while I want it to be constrained to the size of the playable area (which has a fixed size).
This is how it looks now:
This is how it looks when running cargo run (not on browser) and how I want it to appear on the center of the browser's page.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am making a game with bevy and egui. I convert the game to wasm using
wasm-bindgen
to play it on a browser.However, it doesn't look clean since the egui panels always fill out the whole screen, while I want it to be constrained to the size of the playable area (which has a fixed size).
This is how it looks now:
This is how it looks when running
cargo run
(not on browser) and how I want it to appear on the center of the browser's page.The content of the
index.html
looks like this:Any idea how I can achieve this?
P.S. I already tried wrapping the
<canvas>
in adiv
with relative position but that didn't work.Beta Was this translation helpful? Give feedback.
All reactions