ID:273979
 
I'm currently in the process of creating a drag and drop system with a bunch of objs; each being displayed in one grid each.
Basically players will be able to arrange their items like you can in Diablo, WoW etc.
I have concluded I need to set the grid to 33x33 to fit 32x32 icons. Which is odd and defeats the point. But anyway...
The issue is when I have them set to that size, there is a big line on the let side and the bottom side; and the icon is not centred in the grid.

How do I get around this problem? Is it a bug?
Maybe theres something better I can use than grids, for drag n drop?
Saucepan Man wrote:
Maybe theres something better I can use than grids, for drag n drop?

HUDs.
In response to Albro1 (#1)
I have the latest version of BYOND and there are no HUD controls available?
That aside, HUD = Heads Up Display; I fear you've described my system as opposed to anything else? :s
Grid current;y aren't very display friendly. IIRC cels reserve 1p on two edges of the obj in the grid.
In response to Saucepan Man (#2)
Look into the <code>screen_loc</code> and <code>client.screen</code> vars for HUDs
In response to Saucepan Man (#2)
What EW said. HUD's aren't interface controls, they are user-defined screen objects. You create the art, and you don't have the ugliness.
In response to El Wookie (#4)
I'm not convinced HUDs is a solution to my problem...

Specifically, what I'm trying to do is this:

*Have a button on the skin, when clicked it winshows() a window. Within said window I want to display the certain type of objs that the player has in contents.
By dragging and dropping, players can move these icons or objs around from one slot to another.
If they drop one on a pre existing obj, the objs swap. If the slot is empty, the obj just changes locations.

Moreover, the objs can be clicked and dragged to a series of 8 slots - located to the left of the map (for ease of use).

~Whilst in the opened window, Click() shows the details for the obj; and right clicking shows the verbs attached with that obj.
~When in the on-skin hot bar, left clicking performs their primary function (e.g. equip), whilst right ckicjing still opens up the context menu.


As such, I'm not following how HUDs will be the solution? And if they are, I don't get what you mean?

Cheers for reading the long post
In response to Saucepan Man (#6)
Everything you suggested (Aside from maybe the right clicking, you'd probably need to change that to alt+click or something) is possible via HUDs, it would just require quite a bit of programming. I wouldn't be against doing it for you if you really wanted it done, I'd like a donation or something, but I'd do it for free. Right now I'm playing League though, and alt+tabbing between deaths (Far too Frequent)
In response to El Wookie (#7)
:\
The better solution to me seems to be to take a hit with the graphics and continue to use the grids?
They do 100% of what I want but look like crap.
Maybe offsetting their x and y...
In response to Saucepan Man (#8)
That's just bad logic. Have you never read Tiberath's 'It works therefor it's right' developer artical? I'd find it for you but, League.

Make things work for you the best you can.
In response to El Wookie (#9)
Yeah i have - which is exactly why I'm going with the built-in features over my own coding. Which is win-win seeing as the only downside is graphical?

(yes, this is an invitation to correct me!)
In response to Saucepan Man (#6)
Could you provide a small demo project displaying the issues you're having with grids?

If not for grids, another solution that fits your needs could be a browser control with some JavaScript magic for the drag/drop menu. I know DynamicDrive and several other JavaScript resources have some basic drag/drop scripts, and you could always expand on those to produce the effects you need for your own game mechanics.

The benefit to using JavaScript is that the processing for it is handled client-side and is therefore very fast---it doesn't need to communicate with the server until it's ready to commit changes. There are some downsides though and those need to be factored as well.
In response to Hiead (#11)
The client side processing is something that would help. But I'm not convinved the method could be employed in this scenario.

The issues I am having are purely visual; as someone above this post mentioned, the left and bottom sides of a gride will forever have a 1 pixel border.

Seems more like a BYOND flaw than anything else; my current work-around is to reduce the icon size to 30x30 and place the icon @ the bottom-left of canvas.
In response to Saucepan Man (#12)
http://www.byond.com/developer/LummoxJR/SecondHUD
I'm not sure if this will work, but you could try to mess around with it.