Dynamic: Action Button
Finally!
Ok, I'm back and ready to put in some work. Not been the greatest for the last few days, lots of stuff to do, very little time available to devote to this project. But today I'm going to do something! Yep, sure am. . . What though? Let's start with something simple, the dynamic action button visibility.
I'm not sure if I'm going about this in the best way, but I just added a couple of lines to the code in my UI manager that deal with the virtual joystick. Now, if the VJ is supposed to show, it also fires a function to show the dynamic action button. And if the VJ is supposed to be hidden, it hides the button. The thing is, the button (and its reference variable) exists in the HUD prefab. So the UI manager is setting the visibility of the button using a variable reference on the HUD prefab. . . Maybe I should do something a little different here. I should probably add some sort of check first.
So, a quick if statement to check if the current HUD instance is valid. Then if it is, it fires the show (or hide) based on the same settings as the VJ. This is probably not following best practices, but if it works, I'm fine with it. At least for now. Let's test and see! Oops, my bad. . . I accidentally referenced the packed scene for the HUD instead of the current HUD instance. Let's try again. . . and it works, sort of.
The button seems to appear and disappear as it should, but then the quick action button layout breaks (grid containers seem to care if their contents are hidden). I just dropped a new control node as a placeholder under the dynamic action button and hid it. Then added it to the code to do the opposite of the button and now when one hides the other shows, keeping the rest of the buttons in their proper place!
That's It?
Yeah, that's it for today. I really should do more, but I've just not been doing great mentally these last few days. Mostly I'm just tired, lots of late nights, early mornings, and active days. I'll be fine, and I'll push on and keep working on the project, don't worry! LOL, who am I talking to? Is anyone actually reading these things?
Xenodochium
The future is what you make of it!
| Status | In development |
| Author | Munchmo |
| Genre | Role Playing |
| Tags | 2D, Cozy, Godot, Indie, Life Simulation, Pixel Art, Sci-fi, Singleplayer |
| Languages | English |
More posts
- DAB: Interacting!5 hours ago
- Almost Didn't3 days ago
- Troubleshooting: Input4 days ago
- Hud Prefab: More Updates5 days ago
- HUD Prefab: Layout Changes6 days ago
- Virtual Joystick: It's Alive7 days ago
- Virtual Joystick: Wiring In8 days ago
- Planning Is Work9 days ago
- Refactor: Troubleshooting10 days ago
Leave a comment
Log in with itch.io to leave a comment.