If you really really want to do this you can, it's a very simple multiplication. You multiply dimensions by current_res / what_the_layout_was_made_for.
The thing is, I am pretty sure you don't want to do this. What you want is to fix your data! If you don't fix your data now and go with this crude workaround it will bite you later.
Resulotion Scaling
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 18
- Joined: Sat Aug 04, 2012 16:35
Re: Resulotion Scaling
Right I can understand if you have a lot of layouts made using offset that it may seem a lot of work to change them to use scale, however, it's really not that bad if you use CEED load up your layout set the offset to 0 and drag the widget around to fit where it was, it will automatically use the scale component.
If you do want to proceed with this, something along the lines of what you wrote should be ok (though you're only changing width and not height), calculate percentage change in resolution on both width and height and add/subtract percentage of original from your offsets.
Keep in mind though, sometimes you may want to use the offset to keep certain widgets the same size or the same offset from other widgets across resolutions, doing this would resize everything.
If you do want to proceed with this, something along the lines of what you wrote should be ok (though you're only changing width and not height), calculate percentage change in resolution on both width and height and add/subtract percentage of original from your offsets.
Keep in mind though, sometimes you may want to use the offset to keep certain widgets the same size or the same offset from other widgets across resolutions, doing this would resize everything.
Last edited by MorbidAngel on Mon Aug 20, 2012 11:33, edited 1 time in total.
Re: Resulotion Scaling
MorbidAngel wrote: if you use CEED load up your layout set the offset to 0 and drag the widget around to fit where it was, it will automatically use the scale component.
There are 2 tools to convert dimensions in CEED, it cycles for absolute and relative. Just clicking this will convert either position or size to relative. Keep in mind that this might not be entirely what you want to do! But it can be a good starting point.
-
- Just popping in
- Posts: 18
- Joined: Sat Aug 04, 2012 16:35
Re: Resulotion Scaling
Kulik wrote:MorbidAngel wrote: if you use CEED load up your layout set the offset to 0 and drag the widget around to fit where it was, it will automatically use the scale component.
There are 2 tools to convert dimensions in CEED, it cycles for absolute and relative. Just clicking this will convert either position or size to relative. Keep in mind that this might not be entirely what you want to do! But it can be a good starting point.
Ah excellent
Re: Resulotion Scaling
Thanks all, well better to fix the data for sure.
Cheers
Cheers
-
- Just popping in
- Posts: 18
- Joined: Sat Aug 04, 2012 16:35
Re: Resulotion Scaling
metro wrote:Thanks all, well better to fix the data for sure.
Cheers
You're welcome
Yeah i really think you're better off doing that. The more i think about your custom solution the more i think it will be a bad idea tbh. On many of my layouts i do something like: 1.0, -10 to always position something 10 pixels from bottom for instance, your function would screw all those up as well Of course could be worked around but yeah would be even messier.
Who is online
Users browsing this forum: No registered users and 7 guests