Repeat (instead of strech) an image to make a window border

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

TeddyBear94
Just popping in
Just popping in
Posts: 9
Joined: Tue Sep 20, 2011 08:59

Repeat (instead of strech) an image to make a window border

Postby TeddyBear94 » Fri Sep 23, 2011 08:59

Hello Everybody !

I see that for taharezlook, the image used to make for example the window border is simply streched when a window is created.
I wanted to know if it is possible to repeat (instead of strech) an image to make a window border.
I think the thing to change is on .looknfeel file :

Code: Select all

<PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />

What are the value available for this kind of property ? If "Repeat" is available, it would be perfect :P.

Thanks in advance.

Teddy.

TeddyBear94
Just popping in
Just popping in
Posts: 9
Joined: Tue Sep 20, 2011 08:59

Re: Repeat (instead of strech) an image to make a window bor

Postby TeddyBear94 » Fri Sep 23, 2011 13:20

I think I got something :
In Taharez looknfeel file I found this :

Code: Select all

<VertFormat type="Tiled" />

I will try this evening.

TeddyBear94
Just popping in
Just popping in
Posts: 9
Joined: Tue Sep 20, 2011 08:59

Re: Repeat (instead of strech) an image to make a window bor

Postby TeddyBear94 » Tue Sep 27, 2011 09:56

I read more deeply the documentation "Introduction to Falagard 'looknfeel' XML" and I found all I need in it. ==> Resolved.
Really helpful.

Teddy.

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

Re: Repeat (instead of strech) an image to make a window bor

Postby Kulik » Tue Sep 27, 2011 12:01

Please post the solution to your problem so others can see it when they search the forum.

TeddyBear94
Just popping in
Just popping in
Posts: 9
Joined: Tue Sep 20, 2011 08:59

Re: Repeat (instead of strech) an image to make a window bor

Postby TeddyBear94 » Wed Sep 28, 2011 11:54

Well :( ... I didn’t have enough time to test my solution.
As well my solution is tested, I post it.

Teddy.

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

Re: Repeat (instead of strech) an image to make a window bor

Postby CrazyEddie » Fri Sep 30, 2011 06:30

I will post an answer here. The short answer is most definitely yes, this can be done pretty easily.

The slightly longer answer is that in order to do this, there's probably a little more work involved that what would be ideal. Basically the stock skins all use the FrameComponent to specify the images to be used for the window borders, and unfortunately the formatting of the edges for this component is fixed in 'stretch' mode (although it does support changing the formatting of the image used to fill the background area. What this means is, to get the tiled/repeated formatting of edges, you need to 'explode' the FrameCompontent into a set of ImageryComponent definitions, which do allow you to set the formatting of the image drawn by way of the HorzFormat and VertFormat tags - or HorzFormatProperty and VertFormatProperty tags to source that setting from a property.

So, to conclude, basically you just swap the FrameComponent for a bunch of ImageryComponent definitions. It's quite a bit more XML, though internally things are handled much in the same way.

Of course it would be nice if there were format settings for each edge that worked with FrameComponent. If you want to add a feature request to mantis for this (with a link back here), then we would surely look at that some time in the future (as opposed to forgetting about it entirely ;) ).

CE.

TeddyBear94
Just popping in
Just popping in
Posts: 9
Joined: Tue Sep 20, 2011 08:59

Re: Repeat (instead of strech) an image to make a window bor

Postby TeddyBear94 » Fri Sep 30, 2011 12:25

Yep, it is exactly what I did:
I have nine imagerycomponents, I fixed VertFormat to 'tiled' for RightEdge, LeftEdge and Background and I fixed HorzFormat to 'tiled' for TopEdge, BottomEdge and Background.
The most boring is to define the differents size and coordinate for each component.
I have finish to write it but components are not placed as I want (maybe some bad copy and paste).
When it is debugged, I can post the code here.

Of course it would be nice if there were format settings for each edge that worked with FrameComponent. If you want to add a feature request to mantis for this (with a link back here), then we would surely look at that some time in the future (as opposed to forgetting about it entirely )

Oh yeah! Because the xml of "tiledFrameWindowByTeddy" is looong and awful.
I just submit a request to mantis.

Teddy.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 16 guests