active Inventory item displaying on a gui

Started by jamesreg, Mon 18/01/2010 00:23:55

Previous topic - Next topic

jamesreg

Ok I have a gui which has my character avatars and icons and such on it I have a space on the gui I want to display the active inventory item

I have been told to create a button on the gui then in the gui text place (INVSHR)

I have done this and only get a grey button no active inventory item do I have to do something else?

Khris

#1
Just to make sure, you did put "(INVSHR)" as the button's text, right?

Edit: added brackets

jamesreg

thats what I did created a button on my gui
where it says text on the side bar i put (INVSHR)
and all i get is a grey button box you can push
but nothing else no image on it or anything when
i select items

Khris

I tested this using the default game, which has an image assigned to its (INVSHR) button.
As soon as I set the image to 0, the button wouldn't display the active item any longer.
I guess if the button's image is set to 0, all sprite drawing including pasting the item graphic is skipped and the standard button is drawn.

If you don't want any border around the item, just use a rectangle filled with magic pink (255,0,255).

jamesreg

Great I got this to working by doing what you said I created a transparent background and placed on the button now my active inventory items
display correctly.

One more question how do I fix it to where if you click on that image later it will change to that active icon cursor?

Khris

I have a hard time understanding your question. What seems to be the problem?
Clicking anywhere on the rectangular area of the button will change the cursor mode to Useinv / the item.

If the active area seems to be off, recheck the position of the little cross in the cursor modes' previews.

jamesreg

Quote from: Khris on Mon 18/01/2010 12:42:16
I have a hard time understanding your question. What seems to be the problem?
Clicking anywhere on the rectangular area of the button will change the cursor mode to Useinv / the item.

If the active area seems to be off, recheck the position of the little cross in the cursor modes' previews.

I added mouse.mode(eModeUseInv); to the box

and now it works

SMF spam blocked by CleanTalk