Hey, It's been a while since I last posted, But I need a little more help :(
I've created a derma frame and an icon that i can drag, but I need a little help with a slot on it
I'm trying to make a drag and drop inventory you see, I've created the draggable icons, All i need left to do now is make little slots on the frame, here is an image for the example:
[IMG]http://intense-gaming.net/slot.png[/IMG]
Basically I'm trying to make it so my icon, once it's dragged, near/on one of the slots, It automatically goes into that slot.
If possible, may I have some sample code, or pm me or add me on steam: exti503
All help is very highly appreciated.
Hope you can help me. :)
Thank you so much! :)
- UniqueGuy
Can you make checks if any of an icon panel is in the slot panel, if it is, make the icon snap to the position of the slot.
What would be the hooks be for the detecting of the entering of the slot?
Thank you very much!
UniqueGuy
Don't sign your posts. Your name is right next to your post.
Also I guess you should simply make a table for each slot in the grid, then return an itemid, or something alike.
[lua]
mytable[2][3] = 4; [/lua] would then mean x 2 y 3 in your inventory are taken by item 4.
Okay, Thanks
Ehm
But what would the hook be, for when something is dragged near the square slot, then the item icon automatically goes into it?
Thank you very much!
That is how I do mine NewBee. InventoryGrid[i][x][y] - i being inventory number as I could possibly have multiple inventories. (Like having multiple bags in an MMO)
There is no hook. The way I do it is I get my mouse coordinates based on the grid and if it's a valid grid square it changes the position of the item.
Why not just create SpawnIcons and then don't set their model?
[QUOTE=cody8295;34983751]Why not just create SpawnIcons and then don't set their model?[/QUOTE]
He wants dragability, spawnicons dont support dragability.
oh and also you may need some math to do this, im gonna assume the anchor in derma is the middle so all u gotta do is slot1area=slot1/50
im propbably wrong, but hell i tried! plus theres an idea there!
[QUOTE=UniqueGuy;34959243]What would be the hooks be for the detecting of the entering of the slot?
Thank you very much!
UniqueGuy[/QUOTE]
You can compare the position in the panel's Think hook.
Sorry, you need to Log In to post a reply to this thread.