Alternating inventory item sprites to beat alpha channel problem? (Solved)

Started by Play_Pretend, Sat 14/01/2006 07:08:00

Previous topic - Next topic

Play_Pretend

In my game the inventory item graphics all have alpha channels, and when they appear in the inventory screen they come out with jagged edges, because the channel won't display.  This is a normal problem for AGS, as I understand it.  When you select the item with the mouse and it transforms the cursor, the channel displays and the sprite looks right again.

It finally occurred to me that I could outline each of the items' sprites in black (the color of my inventory screen), which perfectly solves the problem of making them look right while in inventory.  However, when selected, the mouse cursor-item retains the black outline.

I searched and found a prior post about Strazer's animated inventory sprites module, but I'm not sure how or whether it was even meant to apply to this problem.  I was wondering if there's a way to script so when the mouse selects the inventory item, it automatically switches to a different sprite of the same item, without the black background, making the mouse cursor look correct.  Any thoughts?

Ashen

This might help. It's a similar problem, and the solution should work for you, too. (Note that you have to have checked the 'Don't use inventory graphics as cursor' box on 'General Settings' for it to work.)
I know what you're thinking ... Don't think that.

Play_Pretend

Wooo!  Yeah!  I got it working!  I put the code in Repeatedly_Exec like you said, using "Cursor" for my custom property, and imported new sprites that all have black-filled backgrounds, but otherwise match my current inventory item sprites.  I set all the inventory items images to have the black-backed sprites as their regular image.  Then I went to each item and changed it's "Cursor" numeric value to match the non-blacked out sprite number.

When I ran it, it looks *perfect*.  The sprites in the inventory window now have no jagged edges, and when you click on them the cursor turns into a perfect clear background sprite instead.  Woohoo!  Thanks a ton, Ashen!

Cinfa

I had a similar problem, but I solved it without using any code:
use a 32bit image as inventory background, and then all your 32bit inventory items will look perfect.

EDIT: ops... I'm getting blind.. forget what I said.

SMF spam blocked by CleanTalk