Unnamed Platformer - Devlog 18
The UI is coming along pretty nicely!
What I did: Designed a full level select menu (there are a couple more things left to add), add a heads up display for the current level, and add proper mouse input and extra details to buttons such as shadows (havent implemented shadows for everything, I’ll explain why) and changing color when hovering. Even though it doesn’t sound like much, it took me a surprisingly long time because my text wasn’t centering…What I didn’t realize is that sf::Text creates invisible offsets for some reason, so when I used getGlobalBounds() it would return that offset too and mess up the centering. I ended up doing some research and realized I had to use the local bounds (i.e. untransformed) when centering.
Challenges: Ig the biggest ‘challenge’ was centering buttons with text, because at first I actually tried to manually fine tune coordinates and whatnot. But then I found out I had to use localbounds and blah blah. Another thing is, I spent a lot of time fine tuning sizes, colors, shadow darknesses and depths, etc. which took a lot of my time. Also no ai used this time either, although I did spend a lot of time researching why my text wouldn’t center itself.
Plans for next time: I’ll just polish up existing menus, and work on background elements. Also I want to add a kind of handbook accessible from the main menu that tells you what stuff does, different powerups, etc. But most importantly, I’m gonna try to find out how to make shadow creation more efficient.
For every text/button, I need a shadow. That means I have to add it as a member in the class, copy the actual object, change the color and offset it, then draw it too. Since I have so many objects that make shadows (all of them in the end, ideally), I’m probably going to make a shadow-making function for readability. Other than that I’ll just play the game and test levels a bunch, which I’ve already been doing a lot to make sure everything is as it should be.
K bye guys
P.S. there’s also still a couple bugs ( UI-related or otherwise) that I have to fix as well
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.