dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Item display box with dynamic size adjustment

  1. #1
    Member
    Join Date
    Sep 2009
    Posts
    88

    Question 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?

  2. #2
    Member
    Join Date
    Sep 2009
    Posts
    88
    takes a while to get a reply :/

  3. #3
    Senior Member Draxus's Avatar
    Join Date
    Sep 2007
    Location
    Florida
    Posts
    123
    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.

  4. #4
    Member
    Join Date
    Sep 2009
    Posts
    88
    And how would you work with the textfields? Also there is a description textfield which can be between 1 and 4 lines.

  5. #5
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,140
    put items into a container.
    take the height of the container sprite and draw a rectangle behind it.
    lather yourself up with soap - soap arcade

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center