inventory transparency

Started by beaver, Tue 04/05/2004 01:23:28

Previous topic - Next topic

beaver

Hi, im having a problem with the transparency on my images in the inventory window. My game is full colur.
The problem is that the images in the inventory window do not have the soft edges like they should. ive tested the same sprites on cursors and they work fine. i noticed the same problem on gui's with the images set as buttons, but all i did was set the gui a transparent background using a dummy transparent image and that fixed it. i cant do that with the inventory window because there is no option to set a background image in the  inventory window itself. its quite a big problem because the outside of the images are white and pixely when they should be smooth.

thanks for any help!

beaver

#1
ive just done a bit more testing and the images become smooth if i set the background image on the inventory gui the dummy transparent image file. but any other image results in the same problem.

oh, also how do i set the space between inventory items? at the moment there is a huge gap and i want them to be close together. is it done with SetInvDimensions? i tried it, and with a small value of 5/10 its the same untill i scroll down and then go back up again, at which point i get a load of the mugs and they are overlaping, but im not even sure im putting it the right place.

Ashen

SetInvDmensions () needs to go in the game_start of the global script. It sets the overall size of the inventory items, not space between them, which my be why you had things overlapping when you set a low value. You should probably set it 1 or 2 pixels higher than the size of your inventory items, and see how the spacing looks.
I know what you're thinking ... Don't think that.

beaver

thanks for the response.

i put SetInvDimensions in the game_start bit (see below)

function game_start() {
Ã,  SetInvDimensions(42,42);
}

my inventory sprites are 40 wide and 4 high. but in the inventory window i have a space between items of about the same width as the sprites are

any ideas?

Ashen

#4
Maybe try ignoring the SetInvDimensions, and use the 'game.items_per_line' and 'game.num_inv_displayed' variables instead?
I know what you're thinking ... Don't think that.

beaver

how exactly would i put those in my script?

Ashen

OK, just realised something - are you using 640x480? If so you need to change it to change it to :

SetInvDimensions (21,21);

Since the script uses 320x200 format numbers.
I know what you're thinking ... Don't think that.

beaver

well, its 800x600
but thanks, it had thge desired effect

Scorpiorus

Quote from: beaver on Tue 04/05/2004 01:23:28
Hi, I'm having a problem with the transparency on my images in the inventory window. My game is full colur.
The problem is that the images in the inventory window do not have the soft edges like they should. ive tested the same sprites on cursors and they work fine. i noticed the same problem on gui's with the images set as buttons, but all i did was set the gui a transparent background using a dummy transparent image and that fixed it.
http://www.agsforums.com/yabb/index.php?topic=12406.msg147849#msg147849

beaver

doh! hrm, maybe if i have 2 gui's, 1 with the dummy alpha background and the buttons in, then another behind that with the background i want, i think that may give me the smooth edges im after. i will try that later

thanks for the help.

strazer

Quoteset the gui a transparent background using a dummy transparent image

Hey, that works!
Then I wonder why it's a problem to display button alpha channels without this trick?

beaver

thats what i was thinking

SMF spam blocked by CleanTalk