Adding an extra image to a FrameWindow looknfeel

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

Anasky
Not too shy to talk
Not too shy to talk
Posts: 41
Joined: Mon Sep 25, 2017 21:34

Re: Adding an extra image to a FrameWindow looknfeel

Postby Anasky » Thu Oct 26, 2017 13:48

Ident wrote:
Anasky wrote:Modifying Falagard does sound like a tougher solution than I initially thought though... I'm assuming you don't have experience in this? (And if you do, got any starting point for me?)

I do have experience in this and the reason I initially advised against it is that it is not very intuitive to work with it and it gets more complicated once you add so called child "auto" windows in falagard, in which case it is often better to add actual real windows, especially if it is just about looks and not functionality related to the parent widget. I wrote a base for a Look N Feel editor for CEED to make it easier to create and edit skins but in its current form it will not help you much either yet, it is also not tested enough.

Can you explain what you mean by "The issue with it though is the AlwaysOnTop=true property. "
Who has this property and why cant you turn it to false ?


Apologies for my slow reply rate. Doing this in my spare time alongside my actual job...
What I currently have:
-> A FrameWindow with the 9 images defined.
-> Code creates a new FrameWindow
-> A separate StaticImage defined
-> Code creates a new StaticImage, with as parent the FrameWindow
-> The StaticImage gets hidden and cropped by the frame of the FrameWindow
-> To solve this I set the property AlwaysOnTop to true, along with ClippedByParent to false.

I am fine with disabling ClippedByParent, but the AlwaysOnTop (which is required to be above the FrameWindow's frame) means it's on top of EVERYTHING instead of just the frame.

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

Re: Adding an extra image to a FrameWindow looknfeel

Postby Ident » Fri Oct 27, 2017 08:36

Anasky wrote:
Ident wrote:
Anasky wrote:Modifying Falagard does sound like a tougher solution than I initially thought though... I'm assuming you don't have experience in this? (And if you do, got any starting point for me?)

I do have experience in this and the reason I initially advised against it is that it is not very intuitive to work with it and it gets more complicated once you add so called child "auto" windows in falagard, in which case it is often better to add actual real windows, especially if it is just about looks and not functionality related to the parent widget. I wrote a base for a Look N Feel editor for CEED to make it easier to create and edit skins but in its current form it will not help you much either yet, it is also not tested enough.

Can you explain what you mean by "The issue with it though is the AlwaysOnTop=true property. "
Who has this property and why cant you turn it to false ?


Apologies for my slow reply rate. Doing this in my spare time alongside my actual job...
What I currently have:
-> A FrameWindow with the 9 images defined.
-> Code creates a new FrameWindow
-> A separate StaticImage defined
-> Code creates a new StaticImage, with as parent the FrameWindow
-> The StaticImage gets hidden and cropped by the frame of the FrameWindow
-> To solve this I set the property AlwaysOnTop to true, along with ClippedByParent to false.

I am fine with disabling ClippedByParent, but the AlwaysOnTop (which is required to be above the FrameWindow's frame) means it's on top of EVERYTHING instead of just the frame.


Yes you should not have to set this. Try setting TitlebarEnabled=False on the Framewindow, after all you are not using this feature anymore are you? This should expand the pane that contains the visible widgets that are currently cut off (if clipping is enabled).
CrazyEddie: "I don't like GUIs"

Anasky
Not too shy to talk
Not too shy to talk
Posts: 41
Joined: Mon Sep 25, 2017 21:34

Re: Adding an extra image to a FrameWindow looknfeel

Postby Anasky » Fri Oct 27, 2017 11:29

Ident wrote:
Anasky wrote:
Ident wrote:I do have experience in this and the reason I initially advised against it is that it is not very intuitive to work with it and it gets more complicated once you add so called child "auto" windows in falagard, in which case it is often better to add actual real windows, especially if it is just about looks and not functionality related to the parent widget. I wrote a base for a Look N Feel editor for CEED to make it easier to create and edit skins but in its current form it will not help you much either yet, it is also not tested enough.

Can you explain what you mean by "The issue with it though is the AlwaysOnTop=true property. "
Who has this property and why cant you turn it to false ?


Apologies for my slow reply rate. Doing this in my spare time alongside my actual job...
What I currently have:
-> A FrameWindow with the 9 images defined.
-> Code creates a new FrameWindow
-> A separate StaticImage defined
-> Code creates a new StaticImage, with as parent the FrameWindow
-> The StaticImage gets hidden and cropped by the frame of the FrameWindow
-> To solve this I set the property AlwaysOnTop to true, along with ClippedByParent to false.

I am fine with disabling ClippedByParent, but the AlwaysOnTop (which is required to be above the FrameWindow's frame) means it's on top of EVERYTHING instead of just the frame.


Yes you should not have to set this. Try setting TitlebarEnabled=False on the Framewindow, after all you are not using this feature anymore are you? This should expand the pane that contains the visible widgets that are currently cut off (if clipping is enabled).


I am using the titlebar. What I want to do is to have the original titlebar's image, followed by another image, followed by the text "Window".
Changed the property and attached a screenshot. It fixed the clipping, but the entire titlebar is (as predicted) gone.
Attachments
TitlebarEnabled_False.png

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

Re: Adding an extra image to a FrameWindow looknfeel

Postby Ident » Thu Nov 02, 2017 22:44

Anasky wrote:
Ident wrote:
Anasky wrote:
Apologies for my slow reply rate. Doing this in my spare time alongside my actual job...
What I currently have:
-> A FrameWindow with the 9 images defined.
-> Code creates a new FrameWindow
-> A separate StaticImage defined
-> Code creates a new StaticImage, with as parent the FrameWindow
-> The StaticImage gets hidden and cropped by the frame of the FrameWindow
-> To solve this I set the property AlwaysOnTop to true, along with ClippedByParent to false.

I am fine with disabling ClippedByParent, but the AlwaysOnTop (which is required to be above the FrameWindow's frame) means it's on top of EVERYTHING instead of just the frame.


Yes you should not have to set this. Try setting TitlebarEnabled=False on the Framewindow, after all you are not using this feature anymore are you? This should expand the pane that contains the visible widgets that are currently cut off (if clipping is enabled).


I am using the titlebar. What I want to do is to have the original titlebar's image, followed by another image, followed by the text "Window".
Changed the property and attached a screenshot. It fixed the clipping, but the entire titlebar is (as predicted) gone.


That looks a bit odd for just deactivating a titlebar, it looks like the entire top of the background is missing. Seems like whoever designed that LNF didnt consider that option, which is fine but means that route will potentially cause more effort to fix.

Anyway, maybe you should really just try to edit the Titlebar look n feel file to add that extra image. Look how other widgets do layered images. Afair the way it is done is by having multiple named sections defined (each has an image) and then in the layer you say you want section image1 and section image2, and the order will specify which is on top of the other. I assume you got some sort of transparency to specify that. I hope that helps although I am still not 100% sure how it should work in your case wrt. scaling etc.
CrazyEddie: "I don't like GUIs"

User avatar
phanjam
Just popping in
Just popping in
Posts: 3
Joined: Mon Nov 06, 2017 09:35

Re: Adding an extra image to a FrameWindow looknfeel

Postby phanjam » Mon Nov 06, 2017 09:47

hi @anasky! i noticed you mentioned you'd been working with CEGUI via notepad++ edits. Would you say that one could get by making stuff in CEGUI just with this method? I know your current issue has forced you to use CEED, but for the most part can things be done via directly editing the .layout files?

In the past I've done very minor editing of some .layout files in the game Torchlight which uses CEGUI - am just hoping I can try more involved editing and still get good results.

Thanks for any tips!

Anasky
Not too shy to talk
Not too shy to talk
Posts: 41
Joined: Mon Sep 25, 2017 21:34

Re: Adding an extra image to a FrameWindow looknfeel

Postby Anasky » Mon Nov 06, 2017 10:15

That looks a bit odd for just deactivating a titlebar, it looks like the entire top of the background is missing. Seems like whoever designed that LNF didnt consider that option, which is fine but means that route will potentially cause more effort to fix.

Anyway, maybe you should really just try to edit the Titlebar look n feel file to add that extra image. Look how other widgets do layered images. Afair the way it is done is by having multiple named sections defined (each has an image) and then in the layer you say you want section image1 and section image2, and the order will specify which is on top of the other. I assume you got some sort of transparency to specify that. I hope that helps although I am still not 100% sure how it should work in your case wrt. scaling etc.


Alright, I'll try that once I manage to find the time to get to it...
Slightly (un-)related, is there a way to modify the order in which GUI icons are displayed? That would solve this titlebar issue easily, and also allow me to fix another issue where I have moving UI elements that I need properly sorted.

phanjam wrote:hi @anasky! i noticed you mentioned you'd been working with CEGUI via notepad++ edits. Would you say that one could get by making stuff in CEGUI just with this method? I know your current issue has forced you to use CEED, but for the most part can things be done via directly editing the .layout files?

In the past I've done very minor editing of some .layout files in the game Torchlight which uses CEGUI - am just hoping I can try more involved editing and still get good results.

Thanks for any tips!


Hello phanjam,
Yeah I do believe using Notepad++ suffices for any modifications you may need to make to your imageset. It's still a useful tool though to ensure you don't have any overlapping (you can load in your notepad++ modified file into CEED to check).

User avatar
phanjam
Just popping in
Just popping in
Posts: 3
Joined: Mon Nov 06, 2017 09:35

Re: Adding an extra image to a FrameWindow looknfeel

Postby phanjam » Sat Nov 11, 2017 00:49

Hi Anasky! Pardon the delayed reply and thanks v much for the input.

I will get/learn CEED then to help with "quality control" :P

Anasky
Not too shy to talk
Not too shy to talk
Posts: 41
Joined: Mon Sep 25, 2017 21:34

Re: Adding an extra image to a FrameWindow looknfeel

Postby Anasky » Tue Nov 21, 2017 20:03

I managed to find a solution :)

1. Create a FrameWindow
2. Add the TitleBox (StaticImage) to the FrameWindow->getChild(0)
3. Change its size so that it is properly scaled
4. Set ClippedByParent to False
5. TitleBox->moveToBack()

6. Add the Label (StaticText) to the FrameWindow->getChild(0)
7. Set HorzFormatting to CentreAligned
8. Set its position and size

Thanks so much for the help Ident :)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 34 guests