In app resizing window with screen resolution change

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

kjub
Just popping in
Just popping in
Posts: 4
Joined: Fri Aug 07, 2015 02:29

In app resizing window with screen resolution change

Postby kjub » Fri Aug 07, 2015 03:36

Hi, thanks in advance.

I'm trying to make a resizable window which has some fixed size child windows and resizing windows.
And it has to satifiy screen resolution change.
Please see below.

Image

http://tempsend.com/5B25DE2587/1C7D/ResizableWindow.jpg

The black window is a parent window, and it is resizable with dragging the frame.
The red window is a fixed size window.
The blue window has to be resized with respect to the black window size horizontally, i mean, width only.
The green window has to be resized with respect to the black window size vertically, height only.
Every window has to be scaled proportionally when a screen resolution is changed.

I tried some ways:

1. red window has 'scale' size (0.1, 0.1)
blue window has scale pos (0.1, 0.0) and scale size (1.0, 0.1)
green window has scale pos (0.0, 0.1) and scale size (0.1, 1.0)

result: the red window size, the blue window height, the green window width have to be fixed, so it goes wrong when the black size is changed.

2. red window has 'offset' size (32, 32)
blue window has offset pos (32, 0) and scale width 1.0, offset height 32
green window has offset pos (0, 32) and offset width 32, scale height 1.0

result: everything looks ok, but it doesn't work when a screen resolution is changed.

3. All is the same as '2'.
But I recalculate 'offset' things by ratio current resolution / previous resolution when a screen resolution is changed.

result: It works! But it's not that easy to code.

What I want to know is...
is there any feature like '3'? I mean, not a truely absolute pixel offset, which is changed when a screen resolution is changed or similar features.
Please let me know and understand lack of my english.
Last edited by kjub on Wed Sep 30, 2015 07:01, edited 4 times in total.

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: In app resizing window with screen resolution change

Postby lucebac » Fri Aug 07, 2015 07:34

I cannot view your Image, there's just "Image" as text in your post - can you upload it somewhere and put the link here?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: In app resizing window with screen resolution change

Postby Ident » Fri Aug 07, 2015 13:46

You can also upload it directly in the forum. The more screenshots we get to understand the issue the better.
CrazyEddie: "I don't like GUIs"

kjub
Just popping in
Just popping in
Posts: 4
Joined: Fri Aug 07, 2015 02:29

Re: In app resizing window with screen resolution change

Postby kjub » Sat Aug 22, 2015 07:14

I just posted image url.
How do I upload an image to forum?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: In app resizing window with screen resolution change

Postby Ident » Sat Aug 22, 2015 17:48

I dont know what the problem is, this is easily achievable in CEGUI. Position everything top-left oriented and make the positions absolute in pixels. Then make the width of top right window to be 1 in x relative width and make the offset the negative width of the top left window in pixels.
For the left window you choose the height the same way (1 in relative, and the absolute negative of the top left window's height). The bottom right window has both width and height set in the described way. Done.
CrazyEddie: "I don't like GUIs"

kjub
Just popping in
Just popping in
Posts: 4
Joined: Fri Aug 07, 2015 02:29

Re: In app resizing window with screen resolution change

Postby kjub » Wed Sep 30, 2015 06:53

Ident //

Problems happen when I change app resolution.
I want to make just one layout for every resolution.
But it's impossible to achieve with only 'absolute in pixel' and 'relative'
because 'absolute in pixel' has to be recalculated when the screen resolution is changed and
has to stay fixed when its parent window size is changed.
To do that I think we need 'absolute in pixel on standard resolution' or something works like above,
Or just recalculate manually as I mentioned earlier.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: In app resizing window with screen resolution change

Postby Ident » Wed Sep 30, 2015 07:57

You can use the AspectRatio feature for sizing if you want to maintain ratios. Use relative positions for positioning. With relative positions and sizes imo you can make a layout for all kind of resolutions while maintaining Ratios. But it won't check for the resolution itself, only the parent window.

You have to be more specific what you want in regard to having sizes and positions depend on resolution, so far I am not sure how this should work.

EDIT: I said something wrong about AutoScale here - this feature only exists for Imagesets and Fonts.
CrazyEddie: "I don't like GUIs"

kjub
Just popping in
Just popping in
Posts: 4
Joined: Fri Aug 07, 2015 02:29

Re: In app resizing window with screen resolution change

Postby kjub » Wed Sep 30, 2015 08:46

Ident //

I just want the feature that a window size changes with respect to screen resolution only,
but doesn't change with respect to its parent window size.
I think it's impossible so far without manual coding, right?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: In app resizing window with screen resolution change

Postby Ident » Wed Sep 30, 2015 08:59

I think you are correct: This is impossible atm. There would have to be an AutoScale property for Windows but it only exists for Imagesets and Fonts.

There is only the AspectRatio as an option.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 6 guests