HUD Groups

by Forum_account
An easy way to manage screen objects.
ID:121700
 
I just posted another update that adds another demo called "inventory-demo". This demo shows how to create a basic on-screen inventory. You can drag and drop items to move, equip, and unequip them. The update also adds some minor changes to interface-demo, the biggest change there is demo-form.dm which contains a sample form that uses all of the on-screen interface controls.

Here is the list of changes:
  • Added the DragAndDrop() proc to the HudGroup object, which is called when a HudObject's MouseDrop() proc is called. You can override the group's DragAndDrop proc to create custom behavior for the group. The proc takes two arguments - the first is the HudObject you're dragging, the second is the object you dropped it on (which might not be a HudObject).
  • Added the "inventory-demo", which contains an on-screen inventory system. Walk over items to pick them up. Use the "toggle inventory" verb to hide or show your inventory, and drag items to move them, equip them, or unequip them.
  • Changed the px and py vars on the HudObject object to "sx" and "sy" so they don't conflict with other libraries of mine.
  • Changed the __px and __py vars of the HudGroup object to be called "sx" and "sy". These vars can be used to reference the group's current position but shouldn't be modified. To change the group's position use its pos() proc.
  • Made some internal changes to how HudGroups hide and show HudObjects, which makes use of the new __hide_object() and __show_object() procs.
  • Added the ability to type spaces to input.dm in interface-demo.
  • Added the #define statement to include the Keyboard library only if you have input.dm included in the interface-demo.
  • Added demo-form.dm to interface-demo. This file defines the "game form" verb which brings up a game creation form. You can type a name, select a level, and click submit, which calls the form's submit() proc which prints out the values you selected.


I am also working on turning the video tutorial I posted yesterday into a written tutorial that contains video clips. Some of the concepts are just better explained by text and, while I had planned to release the code that goes along with the video tutorials, it's just easier for users to follow along if they can copy and paste the code into their own project.

The tutorial covers more than the 15 minute video had covered. I just need to record the video clips, upload them, and embed them in the tutorial and it'll be ready to post.
Most tutorials that I've seen so far usually provide download links for the source code with comments added. That way, the audience can absorb the concept at their own pace and experiment with it at the same time.
FA did u see part 2? do u like it
DarknesOchido wrote:
FA did u see part 2? do u like it

I'm not sure about the rain icon, but the other ones look nice. Did you have a particular demo in mind that I could use it for?

Jemai1 wrote:
Most tutorials that I've seen so far usually provide download links for the source code with comments added. That way, the audience can absorb the concept at their own pace and experiment with it at the same time.

The tutorial I'm working on will provide the complete set of project files at the beginning of the whole tutorial and at the end of each step. That way you can follow along if you'd like, but it also contains videos to show what'll happen if you don't feel like following along.

I wasn't able to upload all of the videos last night, but I should have them done tonight. I'll make another post about the tutorial when it's all ready.
Cool. Keep up the good work!
umm... not really i guess for all of the sidescroll demos o.O