1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Question - Code Setting a tile's alpha in code

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Flip, Oct 1, 2017.

  1. Flip

    Flip Member

    Joined:
    Sep 15, 2017
    Posts:
    149
    Is this possible? The only thing I can see is a reference to a compatibility function "layer_tile_alpha(tile_element_id,alpha)" which should not be used outside of compatibility scripts?

    How can I adjust the opacity of a tile in code?
     
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,778
    You can't currently unless you use your own shader to do it. I'm pretty sure this is a coming feature though...
     
  3. Flip

    Flip Member

    Joined:
    Sep 15, 2017
    Posts:
    149
    Sounds complicated.. yes I read it was a coming feature but that was posted a year ago. Was hoping they got around to it and I've overlooked it. Not sure how this hasn't made it in yet seems important!
     
  4. SRJProd

    SRJProd Member

    Joined:
    Oct 2, 2017
    Posts:
    14
    It does seem like a useful feature, I'd never really thought about it. Might look into it, see if I can think of a temporary/simple solution.
     
  5. Flip

    Flip Member

    Joined:
    Sep 15, 2017
    Posts:
    149
    Useful is right. All games I've theorized could use it, and benefit from the performance of not having to entirely switch through and between tiles or as nocturne said create a custom shader.
     
  6. bbbower

    bbbower Member

    Joined:
    Sep 11, 2016
    Posts:
    58
    Yeah, been beating my head in trying to figure out why this wasn't working, turns out its not only removed but also a unicorn now. Writing a shader would work for some instances, but in particular, I was using the alpha of the tile prior to a shader to send data to the shader to move its position so it kind of kills the whole purpose and I now need to add every tile into a seperate asset and drop it in the level or rewrite the entire draw pipeline and manually read from my own tile mapping file and blah yeah ... i just gave up
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice