Use of crazyeddie gui sources

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Derek
Quite a regular
Quite a regular
Posts: 70
Joined: Wed Jan 12, 2005 12:06

Use of crazyeddie gui sources

Postby Derek » Fri Mar 26, 2004 18:08

nevermind.. i found the STRETCHED rendersetting and i set the size of the image to the size of the desktop every time before rendering

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Use of crazyeddie gui sources

Postby CrazyEddie » Fri Mar 26, 2004 18:12

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!

User avatar
Derek
Quite a regular
Quite a regular
Posts: 70
Joined: Wed Jan 12, 2005 12:06

Use of crazyeddie gui sources

Postby Derek » Sat Mar 27, 2004 18:48

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Use of crazyeddie gui sources

Postby CrazyEddie » Sat Mar 27, 2004 19:32

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.

User avatar
Derek
Quite a regular
Quite a regular
Posts: 70
Joined: Wed Jan 12, 2005 12:06

Use of crazyeddie gui sources

Postby Derek » Sun Mar 28, 2004 00:51

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Use of crazyeddie gui sources

Postby CrazyEddie » Sun Mar 28, 2004 07:46

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.

User avatar
Derek
Quite a regular
Quite a regular
Posts: 70
Joined: Wed Jan 12, 2005 12:06

Use of crazyeddie gui sources

Postby Derek » Sun Mar 28, 2004 10:10

hmm i tried to do what you said to scale the button images, but it still isn't rendering them..

-Derek

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Use of crazyeddie gui sources

Postby CrazyEddie » Sun Mar 28, 2004 10:21

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...

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.

User avatar
Derek
Quite a regular
Quite a regular
Posts: 70
Joined: Wed Jan 12, 2005 12:06

Use of crazyeddie gui sources

Postby Derek » Wed Apr 07, 2004 20:33

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

User avatar
Derek
Quite a regular
Quite a regular
Posts: 70
Joined: Wed Jan 12, 2005 12:06

Use of crazyeddie gui sources

Postby Derek » Wed Apr 07, 2004 22:10

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Use of crazyeddie gui sources

Postby CrazyEddie » Thu Apr 08, 2004 08:21

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.

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