Set color effect not working

Get help using Construct 2

Post » Mon Jul 13, 2015 11:34 pm

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.
Image

edit 3: here's how it OUGHT to look, except the white tiles ought to be various different colors.
Image
B
4
Posts: 6
Reputation: 212

Post » Tue Jul 14, 2015 4:52 am

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).
B
94
S
33
G
20
Posts: 438
Reputation: 17,605

Post » Tue Jul 14, 2015 5:35 am

AllanR wrote: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.
B
4
Posts: 6
Reputation: 212


Return to How do I....?

Who is online

Users browsing this forum: Madave96, RobertMKD and 7 guests