Skip to content

Dynamically Sized Canvas #3581

Answered by CodingTil
CodingTil asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, figured out using https://github.com/simbleau/nbody-wasm-sim. These are the main steps:

  1. Get Canvas:
  2. Create Surface, Window, and Size with canvas:
    • let surface = instance.create_surface_from_canvas(canvas).unwrap(); (code)
    • let window = WindowBuilder::new().with_canvas(Some(canvas))..... (code)
    • let (width, height) = (canvas.client_width(), canvas.client_h…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by CodingTil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant