Resulotion Scaling

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Resulotion Scaling

Postby Kulik » Mon Aug 20, 2012 11:19

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.

MorbidAngel
Just popping in
Just popping in
Posts: 18
Joined: Sat Aug 04, 2012 16:35

Re: Resulotion Scaling

Postby MorbidAngel » Mon Aug 20, 2012 11:24

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.
Last edited by MorbidAngel on Mon Aug 20, 2012 11:33, edited 1 time in total.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Resulotion Scaling

Postby Kulik » Mon Aug 20, 2012 11:28

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.

MorbidAngel
Just popping in
Just popping in
Posts: 18
Joined: Sat Aug 04, 2012 16:35

Re: Resulotion Scaling

Postby MorbidAngel » Mon Aug 20, 2012 11:34

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 :)

metro
Just popping in
Just popping in
Posts: 18
Joined: Mon May 14, 2012 20:24

Re: Resulotion Scaling

Postby metro » Mon Aug 20, 2012 14:49

Thanks all, well better to fix the data for sure.

Cheers

MorbidAngel
Just popping in
Just popping in
Posts: 18
Joined: Sat Aug 04, 2012 16:35

Re: Resulotion Scaling

Postby MorbidAngel » Mon Aug 20, 2012 23:26

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 5 guests