Set color effect not working

0 favourites
  • 3 posts
From the Asset Store
Color all tiles with the same color in 22 moves or less!
  • Hey guys. Sorry if this is a really dumb question, but I've been beating my head against it for a while and scouring the forums and I can't find anything about it.

    So I'm working on a simple maze-type game with a bunch of tiles in a grid. They read info from an array to determine if they're a wall or not, and from a different z-layer of the array to figure out what type of tile they are. I wanted to use an effect to set the color (so an outdoor tile could be green or an indoor tile brown or whatever) but when I apply the setcolor effect all the tiles just become transparent. I bound a key to "disable effect" and they come right back, but no amount of fiddling with the parameters was able to make them be anything but transparent. Can anybody guess what I might be doing wrong?

    Thanks in advance.

    edit: This actually happens for just about any effect I try to apply - the tiles are no longer visible, but if I open in debug mode they're still there, set to visible, and fully opaque - just invisible for some reason.

    edit 2: The display is right in layout, even - it's just when the game starts that the effects start breaking. Here's a comparative screenshot.

    edit 3: here's how it OUGHT to look, except the white tiles ought to be various different colors.

  • I did a quick test on an old project of mine, and the setcolor effect worked just the way it should for me.

    It only works with webGL - are you sure your project is using webGL? Or maybe you are giving the effect invalid parameters... Or maybe it is an issue with the browser you are using (Internet Explorer probably wont work).

    Another approach you could try is to give your tile sprite different animations - a single frame animation for each color you need. Then you wouldn't need to use the effect (or be limited to webGL).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I did a quick test on an old project of mine, and the setcolor effect worked just the way it should for me.

    It only works with webGL - are you sure your project is using webGL? Or maybe you are giving the effect invalid parameters... Or maybe it is an issue with the browser you are using (Internet Explorer probably wont work).

    Another approach you could try is to give your tile sprite different animations - a single frame animation for each color you need. Then you wouldn't need to use the effect (or be limited to webGL).

    Hey Allan,

    Thanks for the reply. I wasn't able to figure out what the problem was, since I tried a lot of different values for the parameters and tested a lot in both Chrome and Firefox, but I ended up doing something similar to what you suggested. I made a couple of different animations for different tilesets, and made each frame of the animation a different tile, so that each tile could be set to the necessary frame at runtime. I think this solution is better in the long run anyway, since it'll let me have more different options for coloration stored as animations rather than having to enter all the different colors I want to use as actions on the event page.

    Thanks anyway though! If I find a solution for my original problem I'll come back here and post it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)