-
Item display box with dynamic size adjustment
I'm looking for suggestions.
Like in many games (diablo, wow, etc.) when the player mouse over an item, a box with a black fill will display the item attributes. That box grow automatically taller when the item has more magical properties.
How would you do this mechanic with AS3 or CS4/CS5?
-
takes a while to get a reply :/
-
Senior Member
I'd probably store all item data in an array with each element representing a single property and then let's say you know each line needs 5 pixels, draw the box like:
graphics.drawRect(0,0,100,yourarray.length * 5)
Where 100 is whatever width you need. This of course only works if you don't need dynamic width and each property only occupies one line.
-
And how would you work with the textfields? Also there is a description textfield which can be between 1 and 4 lines.
-
M.D.
put items into a container.
take the height of the container sprite and draw a rectangle behind it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|