Help chanigng FrameStyles images
Hey all,
I've been at this for hours now and I have no hair left so i'm hoping someone here can help me. What i'm trying to do is change the way windows look by changing the various FrameStyles to use different images. This way I can change it once and have all the windows automaticly use that new look. That seems to be how the default UI does it. While I can change these images just fine, and even properly define source rects, my problem is that it almost seems as though the Size and Location of these images is hard coded or something. The images I put in are in the wrong places and wrong sizes since it seems to be using the location and sizes of the default images whereas mine are different. Can anyone help me here? |
When I was making the TKing Celtic frame I noticed a few things.
1) Each frame is made up of 9 parts -top,bottom,east,west- ne,nw,se,sw- center(this is usually a a selection of blank space to fill the window /imagelist.win_blank_space) 2) The frame is made from a style called rectangle style that identifies each of those parts in it. 3) The size of each piece seems to be hardcoded into the rectangle style. You can change your source rect but it will either stretch or shrink to fit inside the predefined frame limit. Here is what the ui .doc says 7.5.2 RectangleStyle Parent : Style a style that contains 9 images and rules North NorthEast NorthWest South SouthEast SouthWest East West Center ImageStyle NorthStretch - can image stretch NorthShrink - can image shrink SouthStretch SouthShrink EastStretch EastShrink WestStretch WestShrink CenterStetchH CenterStetchV CenterShrinkH CenterShrinkV bool Color - color Opacity - float (0.0 - 1.0) |
One other thing im not sure how everyone else is doing it but I made my own framestyle for the celtic mod and then just started changing individual windows to use it instead of the default. I figured this way folks could have multiple framestyles for the different windows if they wanted them that way.
|
Ok well you pretty much covered what I already new :p
Quote:
|
Well I have it figured out for the most part, but now i'm just having a hell of a time aligning the pieces up :)
|
Its tricky, if you open the celtic .dds you will see that a few of the corners had to be changed inorder to get the framstyle to align them right. so it looks wrong if you open it but in the game its right. go figure :confused:
|
1 Attachment(s)
Heres an image showing what I mean.
|
Yay! I finally got it!
Some things I learned: (Note this is based on doing it in the UIBuilder) 1) Trying to piece together a window frame from multiple image files is much harder than a single one. Unless all the pieces are in the same coords in both files. 2) The SourceRects are important. This is used for alignment internally. NW, N, NE should all have the same top and bottom Y for example. This keeps them lined up. 3) Changes to SourceRects don't always show up properly at first. For example it might not change at all, or it might look squished or stretched ugly. This is ok. If you go to your RectangleStyle and just arrow through the properties it refreshes. |
All times are GMT -5. The time now is 08:11 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI