🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Untitled

posted in DruinkJournal
Published August 14, 2006
Advertisement
Well, text drawing is done and working. I'm reworking my GUI manager which keeps a stack of active windows at the moment. There's something a bit odd going on there, but I'm not sure what. It's a bit of a mess anyway, and could do with a good tidy up.

The way it should work is as follows:
Each window can have up to 10 layered elements, and priority levels 1 to 201 are reserved for the GUI. That lets me have 20 windows open at once, which is more than I should need.
If I have a stack of windows like so:
  • Window 1, Layer 1
  • Window 2, Layer 2
  • Window 3, Layer 3
    And I want to bring Window 3 to the top, I would have to re-order everything. So what I do is I send Window 3 to priority 1 and distribute the other 2 over the remaining space (Since they're going to get moved anyway). So I end up with:
  • Window 3, Layer 1
  • Window 1, Layer 7
  • Window 2, Layer 13
    Or something close to that. This way, if I then need to bring Window 2 to the top, I can move window 3 down a layer, and bring 2 to the top. Basically, it means changing priority left, which could me quite expensive. Changing priority for a window means changing the priority for all of it's widgets, and that usually means removing and reinserting it into the scene graph. It might not be too expensive, but it's still something I'd rather avoid doing all the time.

    However, I might just be lazy and do the obvious thing and change all the priorities every frame, just to get something working. It depends if I can get it working on the way home or not. I got very little done this lunch break due to 3 bands adding me on MySpace, resulting in much spammage. Apparently after 50 comments, MySpace gives you one of those "Please type in the letters in the image above" things every 10 comments. Which slowed me down somewhat. Oh well, what a pity, who cares.
  • Previous Entry Untitled
    Next Entry Untitled
    0 likes 0 comments

    Comments

    Nobody has left a comment. You can be the first!
    You must log in to join the conversation.
    Don't have a GameDev.net account? Sign up!
    Advertisement
    Advertisement