StaticText Size

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
catalin1976
Just popping in
Just popping in
Posts: 8
Joined: Wed Nov 02, 2005 08:20
Contact:

StaticText Size

Postby catalin1976 » Wed Nov 02, 2005 10:31

Hello!

I have a simple question. Is it possible to create a StaticText with a size bigger that 1.0?

If yes, how can I do it? I really need for my tree control implementation.

I have attached 2 images. In the second image the red from the viewport node must be like in the first image. The bug appear only when the size of the viewport is bigger that 1.0.

Thank!

Image

Image

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: StaticText Size

Postby martignasse » Wed Nov 02, 2005 18:32

hi,

Is it possible to create a StaticText with a size bigger that 1.0?
yes, you can, you did it ;)

The bug appear only when the size of the viewport is bigger that 1.0
It because a widget having a size bigger than one mean "bigger than his parent, and by default, clipped by him"
You should use setClippedByParent( false ) on viewport to disable this.

but i suspect something wrong in you'r dimension computation if you have to use size>1.0. I don't see anything on the shot forcing you to do that.

Maybe check you'r maxsize of the viewport parent.

anyway, you'r app seem's very cool, want to see more :hammer:

keep up the good work :)

User avatar
catalin1976
Just popping in
Just popping in
Posts: 8
Joined: Wed Nov 02, 2005 08:20
Contact:

Re: StaticText Size

Postby catalin1976 » Thu Nov 03, 2005 02:21

Hi again!

The colour red of the viewport is in fact a static text with the background colour set to red. I have check the again the calculation of the height is correct.

In the screen shoot the red must be longer that the green of the rotation.

I don't know where the problem is so if you could help me I would be grateful.

Thank you!


Image

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: StaticText Size

Postby lindquist » Thu Nov 03, 2005 03:41

Have you checked the max size for the window that is being clipped?

The default maxsize for a window is (1, 1) relative.

so if your background window needs to be larger than that, you must change the maxsize first.

Code: Select all

// Will set the max size to:
// width = 200px
// height = 3*(parentheight)
Window* w = ...
w->setWindowMaxSize( UVector2( UDim(0,200), UDim(3,0) ) );

User avatar
catalin1976
Just popping in
Just popping in
Posts: 8
Joined: Wed Nov 02, 2005 08:20
Contact:

Re: StaticText Size

Postby catalin1976 » Thu Nov 03, 2005 09:23

Thank you!!!!!

The problem is now solved!
Now when I modify the size of the staticText I modify also the window max size.

Thank again!


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 2 guests