Plugin doesn't respect UI Zoom Factor onInit
-
@d-healey The 50% button is the default, and that is the one that is pressed upon export.
-
@ccbl Does using Engine.setZoomLevel make a difference?
-
@d-healey I'll give it a try. I used
Settings.setZoomLevel(0.5)
because the compiler said that
Engine.setZoomLevel
was depreciated.
-
@ccbl ah case in that case it probably won't help
-
@d-healey yeah it didn't make a difference. Do you think it could be the buttons being in a radio group that is messing things up? Or do you think that it's just the script doesn't read the state of the buttons until one of them is pressed for the first time?
Still a little puzzled why
Settings.setZoomLevel(0.5);
outside of the button callbacks doesn't correctly set the zoom level on init though. -
@ccbl when using toggle buttons make sure to always use
if (value) {}
if (value) { Settings.setZoomLevel(0.75); }
in your case the callback fires for each button and executes the statement even if the button value is false but it should only set the value when its true.
that should do the trick.
-
@oskarsh how would that look in context?
inline function onFiftyControl(component, value) { Settings.setZoomLevel(0.5); }; Content.getComponent("Fifty").setControlCallback(onFiftyControl)
Do you define the value as 1.0?
I really don't know coding very well.
-
@d-healey just out of interest, is there a way to detect the screen resolution by any chance? it would be a nice way to set a default zoom level accordingly so the user doesn't have to. e.g. I'm always having a hard time on a 5k monitor with plugins being microscopic and many manufacturers aren't even bothered to make the GUI sizable at all... those are the plugins I ususally don't buy because they are unusable for me. I have a ruptured retina and very poor eyesight so I'm naturally paying attention to usability and visibility a lot
-
@Morphoice
Settings.getUserDesktopSize()
might help you -
@ccbl Setting it in on init won't work because the button callbacks are triggered after on init so it will overwrite it.
Just as a test, what happens if you disable saveInPreset on all the buttons, except the one you want?
-
@d-healey saving the gui size in a preset doesn't make much sense though, so disabling that shouldn't be a problem
-
@Morphoice said in Plugin doesn't respect UI Zoom Factor onInit:
saving the gui size in a preset doesn't make much sense though, so disabling that shouldn't be a problem
I'm just suggesting this as a test to figure out the source of the issue. But you don't want it to always open at 50% so we need to find a better solution after.
-
@d-healey but the zoom level is always restored to the last state right? So why bother with all that? You just need to read what is the current zoom to reflect this to the right button, at least this is how I see it...
-
@ustk said in Plugin doesn't respect UI Zoom Factor onInit:
but the zoom level is always restored to the last state right?
Only if you use the built in custom settings floating tile which saves it to the generalSettings.xml file.
-
@d-healey Hmm... should be the same thing no? I thought it was always saved in the xml no matter where the call is coming from (when the plugin/standalone is closed)
-
@ustk Yeah just tested and seems you are correct.
-
@ccbl said in Plugin doesn't respect UI Zoom Factor onInit:
@oskarsh how would that look in context?
inline function onFiftyControl(component, value) { Settings.setZoomLevel(0.5); }; Content.getComponent("Fifty").setControlCallback(onFiftyControl)
Do you define the value as 1.0?
I really don't know coding very well.
so like this:
inline function onFiftyControl(component, value) { if(value) Settings.setZoomLevel(0.5); }; Content.getComponent("Fifty").setControlCallback(onFiftyControl)
-
@Lindon Genius!
-
@d-healey ha ha ha ha.....
-
@Lindon wow sleek and elegant solution!