![]() |
Need some advice on this approach..
I am making a mock up of an inventory system, and I want to have grid alignment.
Ex: 0 0 0 0 0 0 0 0 Not: 00 0 0 0 0 00 At the moment, I am using a frames control, And showimg for the icons (32x32 pix), and that works fine. What I want to do, is, say for example I have an icon that id 32 pix wide, and 64 pixels in height. I need that to take up grid space like this: 0 0 X 0 0 0 X 0 Without allowing anything else To display in that slot (X's refer to 32x64 item.) I have thought of checking for the width/height of the image and basically chopping it in two and displaying two halves (one half in each corresponding frame) but that seems messy. |
So, an inventory system like Diablo, Torchlight, Neverwinter Nights, Path of Exile, etc? Items take up different spaces but basically as a different sized square?
|
Quote:
Here's What I have so far (not much at all, mind you...)... I've actually gotten stuck on the dragging part. :[ Everything I try it just shows the image UNDER the GUI, and doesn't seem to move with the mouse. http://pastebin.com/9u8Bxa75 |
Quote:
e.g. PHP Code:
|
You could opt to just make a grid of indices that correlates to the image grid. When an item is placed into the grid, it would set indices of the array to 1 where it's blocking.
Should be pretty simple using standard grid algorithms (ie, mod and int division) |
Quote:
|
| All times are GMT +2. The time now is 04:17 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.