• entries
    707
  • comments
    1173
  • views
    433802

Textury

Sign in to follow this  
Programmer16

69 views

One last post before I go into my cave and hibernate until Monday. I spent all day working on fixing up my GUI and everything turned out really good. It took me about half the time it would have if I hadn't prepared my classes before hand (I would have had to modify each widget's render function to take a texture, then I would have had to modify my GuiVertex class to take texture coordinates, etc.)

I fixed a bunch of little things and added a nice new bug that can't really be fixed. Here's a list of pretty much everything that's been done:

  • Each main widget recieved a LoadSkinInfo() static function as well as some corresponding static variables. This function take's the skin directory, not an actual filename.
  • WidgetManager gained a LoadSkinInfo() which calls all off the main widget's LoadSkinInfo()
  • Faders now work correctly(meaning left is 0, not 10 and right is 255, not 245; this gives me hope for scrollbars.)
  • ListBox buttons are now on the right side
  • The DropDownList button is now on the right side
  • The Tally's plus/increase button has been moved to the right side
  • The Counter's plus/increase button has been moved to the right side
  • Button recieved some overlay information (to allow for texture overlays)
  • Each widget is now the EXACT size that you set it at (before some widgets were way off. For example, the buttons for the list boxes were at (Position - 28), the tally's display area was about 52 pixels longer due to the buttons, the counter was about 28 pixels longer, etc.)
  • A file system was put into place (but is going to be replaced with a CSS like file system in the near future.)
  • The Tally's bars are now textured
  • The ListBox's buttons, DropDownList's button, Tally's buttons, and Counter's buttons were switched over to the overlay system.
  • The CheckBox was switched over to a textured X.
  • Modified some of the Set() funtions for some widget. The Fader is an example, I removed the Text parameter from it's Set() method since it doesn't have any text.


The bugs that I mentioned have to do with the Tally system. I tried to set a limit so that it would only display as many as it could fit, but my calculations are off or something because sometimes (depending on the size of the widget) it may display one to many.) Either way, if used properly it should work fine. I included this widget for use in a system like Baldur's Gate's weapon proficiency.

Anyway, screenshot time!

Textury


Here are a few of the files that it uses (the comments are added so you know what each value is):

Skins\Default\ListBox.txt

0 // X offset
86 // Y offset
12 // left side width
12 // top height
12 // right side width
12 // botom height

255 0 0 0 // inactive background argb color
255 51 51 51 // hover background argb color
255 51 51 51 // active background argb color
255 204 153 0 // clicked background argb color

255 255 255 255 // inactive text argb color
255 255 255 255 // hover text argb color
255 255 255 255 // active text argb color
255 0 0 0 // clicked text argb color





Well actually, that's the only one that I'm going to show since the rest pretty much look exactly the same except without the color values.

When I get around to chopping apart my CSS loading code, the above file will look something like so:

button.MainMenu
{
Offset: Point(0, 86);
Sizes: 12;
Background-Color: argb(255, 0, 0, 0);
Hover-color: argb(255, 51, 51, 51);
}




You get the idea. And yes, I am thinking about allowing different classes. All of the CSS loading code is done, I just have to add some pre-defined function parsers and chop into a library.

I'll upload a demo in the morning, I'm too tired right now.
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now