Thursday, March 14, 2013

Fast RPG Update 1


- Much more accurate drag code (was using the 3d camera as reference instead of the 2D one. d'oh.)
- Drag n drop working from inventory to equipment

- Topbar: enemy lv text and name now also infront
- Drag n drop also working from equipment to inventory now

Inventory to equipment drag 'n drop and vice-versa

After I implemented this feature in the inventory code I noticed it was really inaccurate.
I know I've had some problems like this before with the stash<->Inventory drag code but this time I couldn't fix it by moving the UI further back or front so I checked the drag code for mistakes.  

Well, it seems I was using the wrong camera for determining where the player mouse/finger is.
I use 2 cameras in the game for achieving a 2.5D effect, one that renders the 3D parts and one that renders the sprites.
The one I was using until now for dragging was the 3D one, so the positions in the game world it gave me didn't correspond to the sprites rendered.

More accurate drag 'n drop everywhere

Because of the fix, drag 'n drop is working better than ever!


Not much I can show except the enemy level and name text in the topbar and me dragging a sword from the equipment window to inventory:


No comments:

Post a Comment