Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Background + Alpha Values? (GM7)


SkyLights

Recommended Posts

So basically, I am looking to take this particular tileset...

transparencytileset.png

And throw an alpha value onto it (0.3) and lay it onto a pyramid. The help file is confusing the crap out of me though with these methods.

background_replace_alpha(ind,fname,preload) Same as [background_replace] but in this case the file has an alpha channel.

background_set_alpha_from_background(ind,back) Changes the alpha (transparancy) values in the background with index ind using the intensity values in the background back. This cannot be undone.

So far, I tried just doing background_set_alpha_from_background(bgAlpha, 0.3), but that produced a very weird result:

ew.png

Help plz :(

Link to comment
Share on other sites

Nono, background_set_alpha_from_background sets the alpha from an alpha image (in this case a background). What you should do is make a gray background of color 77 = 0.3 * 255 the size of your tile and then use background_set_alpha_from_background( bgColor, bgAlpha); where bgColor is the background you have and bgAlpha is the gray alpha sprite. Note that you can do this at the very beginning of the game and then delete the alpha sprite to save memory.

I also think GM 7 has the ability to load alpha from a .png with transparency, that's what the background_replace/add_alpha functions are, I believe.

  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...