Closed darthdeus closed 2 years ago
Hi! Thank you. Could you please add usage of the new feature to the demo? Also, I think I would merge this PR after new version of egui-miniquad
will be released. Just not to forget about it.
@darthdeus Hello, about egui_mq_cfg
: It seems required to permit access to Miniquad::EguiMq.egui_input
to be able to change miniquad used pixels_per_point
like in following (imagine this code in program using egui_macroquad
) :
// Set egui scale
egui_macroquad::egui_mq_cfg(|equi_mq| {
equi_mq.egui_input().pixels_per_point = Some(2.0)
});
Hi! Thank you. Could you please add usage of the new feature to the demo? Also, I think I would merge this PR after new version of
egui-miniquad
will be released. Just not to forget about it.
Added a slider to the demo that adjusts UI scaling of egui
.
@darthdeus Hello, about
egui_mq_cfg
: It seems required to permit access toMiniquad::EguiMq.egui_input
to be able to change miniquad usedpixels_per_point
like in following (imagine this code in program usingegui_macroquad
) :// Set egui scale egui_macroquad::egui_mq_cfg(|equi_mq| { equi_mq.egui_input().pixels_per_point = Some(2.0) });
I don't think this is necessary, since you don't need to access egui_input()
/ egui::InputState
, you can just set this on egui::Context
via ctx.set_pixels_per_point(2.0)
I've addded an example of this to the demo where it doesn't use egui_mq_cfg
but just the egui::Context
passed in to egui_macroquad::ui(|ctx| { ... ctx.set_poixels_per_point(...); })
I don't think this is necessary, since you don't need to access
egui_input()
/egui::InputState
, you can just set this onegui::Context
viactx.set_pixels_per_point(2.0)
I've addded an example of this to the demo where it doesn't use
egui_mq_cfg
but just theegui::Context
passed in toegui_macroquad::ui(|ctx| { ... ctx.set_poixels_per_point(...); })
Okay thanks :) I will use this way to set pixels in my own program.
I'll be able to review this PR on the weekend, has a lot of work to do.
It seems
egui-macroquad
is not currently compatible with the latestegui-miniquad
after https://github.com/not-fl3/egui-miniquad/pull/40 was merged.I'm basing this off of https://github.com/optozorax/egui-macroquad/pull/20 as that seems to be related to the original macroquad issue.I'm not entirely sure if that is required, but the PR doesn't compile with miniquad after the fix.This PR makes
egui-macroquad
work with latestegui-miniquad
again, and based on my quick testing it seems UI scaling works with these changes.Maybe a question for @buxx or @emilk, does theegui_mq_cfg
still make sense after those changes?I'm also not sure ifmq::Context
should be exposed up viaegui_macroquad::ui(...)
, but since this causes existing code to fail to compile I thought it probably shouldn't? It's not a big change, but I don't know the reason why it was added in the first place, so it's hard for me to judge if it should be ignored at the level ofegui-macroquad
or passed up as a breaking change.edit: Removed the
egui_mq_cfg
from #20 since it's not needed anymore