Game Development Community

Minor Update and GuiWindowCtrl Gripe/Fix?

by Rob Parton · 02/02/2007 (12:15 am) · 2 comments

Today, for the first time in a few weeks I had a chance to mess around with some interface stuff. I haven't had much of a chance in the last month or so since moving again, but I did have lots of time to think.

The first was to do an interestly different window frame. After some suggestions from a few friends I did come up with something. Namely, this:

www.zodiac-braves.com/mockup/test1.jpg
Not too bad, kinda pretty. However, I did realize something very quickly. I was having issues when trying to drag the window around. After a bit of frustration I decided to look at the actual source, and found the following in GuiWindowCtrl::onWake()....

mTitleHeight = buttonHeight + 4;
   mResizeRightWidth = mTitleHeight / 2;
   mResizeBottomHeight = mTitleHeight / 2;

That would be why mine wasn't working particularly well! So, I changed it to...

mTitleHeight = mBitmapBounds[BorderTopLeftKey].extent.y;
   mResizeRightWidth = mBitmapBounds[BorderRight].extent.x;
   mResizeBottomHeight = mBitmapBounds[BorderBottom].extent.y;

There! Now the zones for resizing and moving the window are based on the specific skin and not hard coded!

Huzzah!

#1
02/02/2007 (1:12 am)
Looks pretty good!!
#2
02/02/2007 (5:54 am)
Very, very nice!