Improved Drag And Drop (07-2024 W2)
Among other UI-related things, I decided to redo the Djinn Menu so it handled drag-and-drop the same way another project of mine (Digital Craftsman) did. Of course, it took some doing… Flexalon didn’t have support for that built-in, and it had been a pretty long time since I first implemented this feature in Digital Craftsman ^^; Thankfully, I was able to use that project’s source as reference.
How Was It Pulled Off?
It was mainly with these 3 components:
- Swappable
- This signals when it gets clicked, dragged and such
- SwappableManager
- This responds to the above and handles the switcheroos
- ControlLayoutsOnSwap
- This makes it so that the layout-prep is disabled when entries are being dragged or swapped, and then enabled otherwise
When a swap or drag starts, the manager keeps track of the swappables’ original parents, positions, etc. It then uses that info to make sure that things get moved and parented to the right stuff. Another thing done at this time is reparenting the relevant entries’ transforms so they’re rendered above the rest of the UI.
And because why not, I made it so that the player can pull off the switcheroos through plain old clicking instead of drag-and-dropping. And just like with the batsys buttons, they change size based on whether or not they’re being hovered over.
What It Looks Like In Action
Looking Back...
It was a mistake for me to have this functionality handled mainly through visual scripting in DC… Not just because of how specific to that project the implementation was, but because of a lack of reusability. Maybe in the future, I’ll release this D&D system to the public.
Get Trigram Islands
Trigram Islands
Golden-Sun-Esque JRPG
Status | Released |
Author | CG-Tespy |
Genre | Role Playing |
Tags | 3D, Anime, JRPG, Short, Turn-based, Unity |
More posts
- Initial Release (10-2024 W3)57 days ago
- Downscoping And The Initial Release (10-2024 W2)63 days ago
- Story Time: Damage Calcs (09-2024 W2)90 days ago
- More BatSys and Overworld Integration (09-2024 W1)96 days ago
- Setbacks And Redos And Title Sequences, Oh My! (09-2024 W0)Sep 02, 2024
- Audio Sys Ready (08-2024 W4)Aug 25, 2024
- Audio Sys Looping (08-2024 W3)Aug 16, 2024
- Audio-Management & Title Screen Progress (08-2024 W2)Aug 11, 2024
- UI Progress (08-2024 W1)Aug 04, 2024
- Coming off Hiatus (07-2024 W4)Jul 28, 2024
Leave a comment
Log in with itch.io to leave a comment.