Closed tachyon-ops closed 2 years ago
Actually, got it:
let scale_factor = window.scale_factor();
let mut size = window.inner_size();
let dimensions: LogicalSize<u32> = size.to_logical(scale_factor);
let mut ui = conrod_core::UiBuilder::new([dimensions.width as f64, dimensions.height as f64])
.theme(conrod_example_shared::theme())
.build();
We need to convert from window dimensions (which are scaled) to actual pixel dimensions. Then it's fine.
Hi all,
I am using conrad with backend
wgpu
. I was able to extract theconrod_example_shared
UI example and place it in a standalone project. Now I went on and started tweaking and figuring out what all the moving parts were doing. I came across the fact that I cannot use a dynamic window size. Say, instead of setting up the window like this:I would like to allow the window to be constructed without a defined size. Then later on we could setup the UI like this:
instead of
But then I get the following error:
If I comment out
render_pass.set_scissor_rect(x, y, w, h);
I get to run the example, but of course my layout is broken.Is it possible to make the size of the UI dynamic from window size instead of making the window a specific size? That would be nice for any kind of window from any kind of platform (also for fullscreen). Am I missing something?