Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Inventory "area" rectangle  (Read 2465 times)

0 Members and 1 Guest are viewing this topic.

TheDerman

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 225
    • View Profile
Inventory "area" rectangle
« on: December 09, 2005, 04:24:34 AM »

Hi again,

I can't seem to get any items to appear in my inventory - the code for adding them to the inventory is fine as I've checked it over - same code as I've always done.

I think it's the inventory "area" rectangle that's the problem.

Code: [Select]

INVENTORY_BOX
{
  ITEM_WIDTH = 42
  ITEM_HEIGHT = 42
  SPACING = 10
  SCROLL_BY = 1
  HIDE_SELECTED = TRUE

  AREA { 0, 558, 800, 42 }
  EXCLUSIVE = FALSE
;  ALWAYS_VISIBLE = FALSE

  WINDOW
  {
    X = 0
    Y = 558
    WIDTH = 800
    HEIGHT = 42
    IMAGE = "interface\inventory_background_place_holder.jpg"
    SCRIPT = "interface\inventory.script"
 
  }
}


The actual inventory windows displays fine in the desired location, but how does that "area" work exactly? The documentation says the points are "x, y, width, height", so as far as I can see the area rectangle should be fitting perfectly over the inventory window, and the items should be showing up nicely, but there's just nothing there.

Each of my inventory "items" are square images 42 x 42, which is the height of the inventory window and the area rectangle, so what's the problem? Anyone know?  ???

Thanks again.    8)

EDIT - So the X and Y of the "area" are the X and Y corresponding to the inventory window top left corner, not the scene corner?

I made it work now, but I don't know - it just worked after I altered some numbers - I still don't understand how that "area" ties excactly to the window and whether there are any rules are not. It seemed to work when I entered massively large numbers and then I worked backwards from there testing and testing until the numbers were nice and small again.   ???

Works anyway, which is good.  ;D
« Last Edit: December 09, 2005, 04:50:49 AM by TheDerman »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Inventory "area" rectangle
« Reply #1 on: December 09, 2005, 09:23:50 AM »

That's right, the area is *relative* to the inventory window, not screen, and the four numbers represent X, Y, Width and Height.
So, for example, if your inventory window is 800x60 and you want 10 pixels border, you'd set the area to 10, 10, 780, 40. No matter where on screen the inventory window is placed.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.034 seconds with 20 queries.