Use of crazyeddie gui sources
Moderators: CEGUI MVP, CEGUI Team
Use of crazyeddie gui sources
nevermind.. i found the STRETCHED rendersetting and i set the size of the image to the size of the desktop every time before rendering
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Use of crazyeddie gui sources
You need to set the render mode for the RenderableImage to RenderType::STRETCHED this will scale it to whatever size you set the RenderableImage to.
As for the other strangeness, I'll have to have a little play around, as this is not the kind of behaviour that you should get.
Edit:
Posted before I saw your other message. Glad you found it ok!
As for the other strangeness, I'll have to have a little play around, as this is not the kind of behaviour that you should get.
Edit:
Posted before I saw your other message. Glad you found it ok!
Use of crazyeddie gui sources
do you know how to do the stretched behavior for buttons? I'm using images on buttons for the menu, but as i expected, their sizes don't change when you change resolutions (even though i scale the size of the button to the resolution). I've tried changing the POSITION rendertype in the WLButton code file to STRETCHED, but that completely gets rid of all the button graphics (so the little down arrows on scroll bars are gone too, etc.).
-Derek
-Derek
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Use of crazyeddie gui sources
That could be considered a bug. I've just did a little test, and I see what you mean. I'll code a fix based on my suggestion below sometime.
What I would advise is adding an option to the button to stretch the image, and have that change the image mode, also you'll want to add code in the onSize handler to re-size the images if they're set-up for stretching. You could just change the mode to STRETCHED (as you did) and add the code in onSize without an option, but this makes all the imagery really ugly, so an option is better.
If you want to scale the little arrows as well, and have it done so they're not ugly, then you'd need to add code to the scroll bar to scale properly based on resolution, rather than specifying the full size of the button. Though this is not really needed as the 'standard' image buttons should look okay.
What I would advise is adding an option to the button to stretch the image, and have that change the image mode, also you'll want to add code in the onSize handler to re-size the images if they're set-up for stretching. You could just change the mode to STRETCHED (as you did) and add the code in onSize without an option, but this makes all the imagery really ugly, so an option is better.
If you want to scale the little arrows as well, and have it done so they're not ugly, then you'd need to add code to the scroll bar to scale properly based on resolution, rather than specifying the full size of the button. Though this is not really needed as the 'standard' image buttons should look okay.
Use of crazyeddie gui sources
yeah i think one of the biggest things right now is scalability. Getting the gui to look the same (same size in proportion to the screen, etc.) is kind of difficult ...
-Derek

-Derek
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Use of crazyeddie gui sources
Resolution independance is something that I never really considered when I produced the current versions of the system (though it was mentioned a lot later on), and while it's not impossible to achieve, it could entail quite a bit of modification to make it work, especially if you want to go right down to the basic widget imagery.
Use of crazyeddie gui sources
hmm i tried to do what you said to scale the button images, but it still isn't rendering them..
-Derek
-Derek
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Use of crazyeddie gui sources
What I did last night when I was messing about, was change the render type in the WLButton constructor from POSITION to STRETCHED (as you already did), and as you stated all the button imagery disappears. So then I added code to the onSize handler in WLButton to re-size the image objects...
That needs to go before the calls to centreNormalImage(); etc.
This made the images render, but it looked crap as the scaling for the little arrows and especially the 'thumb' on the scrollbars was all wrong. Although as I said before, this ugliness could be limited via an option which only scales buttons that request it.
Code: Select all
d_normalImage.setSize(getWidth(), getHeight());
d_hoverImage.setSize(getWidth(), getHeight());
d_pressedImage.setSize(getWidth(), getHeight());
That needs to go before the calls to centreNormalImage(); etc.
This made the images render, but it looked crap as the scaling for the little arrows and especially the 'thumb' on the scrollbars was all wrong. Although as I said before, this ugliness could be limited via an option which only scales buttons that request it.
Use of crazyeddie gui sources
what would the easiest way to scale EVERYTHING drawn be? Is there something i can just add to the SpriteSet class?
-or-
what would be the easiest way to scale the vertical/horizontal slider bars?
Thanks!
-Derek
-or-
what would be the easiest way to scale the vertical/horizontal slider bars?
Thanks!
-Derek
Use of crazyeddie gui sources
also... how would i make a primary selection in a combobox? somthing like WLComboBox wl; wl.setSelected(wl.addString("test")); is what i'm trying to achieve, but everything i've tried to do to implement it doesn't seem to work.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Use of crazyeddie gui sources
Combobox:
To the outside world the drop-list has no selection when it it not displayed. However, when it is displayed it will auto-select any entry that is equal to the text in the edit-box. So, you just need to set the text in the editbox to whatever you want selected. The following code would achieve this.
I know it's not the most intuitive or elegant solution, but it works!
Scaling:
What you could do is add a 'scaling factor' property to the SpriteSet class, and then have the drawing methods and the methods that return the size of the sprites multiply by this scaling factor, this would basically enable the scaling to be transparent to everthing else - this approach is very similar to what I'm considering putting in the new system.
To the outside world the drop-list has no selection when it it not displayed. However, when it is displayed it will auto-select any entry that is equal to the text in the edit-box. So, you just need to set the text in the editbox to whatever you want selected. The following code would achieve this.
Code: Select all
WLComboBox wl;
wl.addString("test");
wl.setEditText("test");
I know it's not the most intuitive or elegant solution, but it works!
Scaling:
What you could do is add a 'scaling factor' property to the SpriteSet class, and then have the drawing methods and the methods that return the size of the sprites multiply by this scaling factor, this would basically enable the scaling to be transparent to everthing else - this approach is very similar to what I'm considering putting in the new system.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 20 guests