Does the color detection work if the color is on the background?
Am currently working on a game involving hiding in the dark, and when you hit a white spotlight for example, you are seen. I would like the lights to instead be an animated background so I can make complicated patterns without having to make them as actors.
Also would color detection work if say, instead of that box you used in the example, a human sprite with a more complicated walk cycle?
Thanks in advance.
Really quickly. I made a mistake. actor.X and actor.Y refer to the upper most left spot on the actor.
Ok, so the pixel detector picks up the pixel color you see. So it does not matter what the object that it is detecting is. It does not deal with stencyl. It deals with the actual pixels on the screen. So if ANYTHING is white on the screen, it will signal. #2 You will have to place the pixel checker at a place where the actor will not be interfering with. So, say you put it to
actor.X - 1, actor.Y
That will always place the pixel checker one pixel away from the left corner. So no matter what your actor does, it will always be one pixel off of the actor. But, in your case you might want to put a couple of checker. (you might want to put one in front of the actor to check if the actor is entering a white spotlight.) that is when you will have to be watching out for that kind of stuff. And you will have to put the pixel checker in relation to the actor. (so say you want the checker to be in front of the actor. and say your actor is 30 pixels wide. You will have to put
actor.X + 31, actor.Y
But the tricky part is finding out how many pixels your actor is, and what to write in the code, and if or if not the actors position will change and interfere with the pixel checker.) also in this case you may want to add 2 points/checkers. One on the right side, and one on the left. (the left one will be easy. Just type in
actor.X - 1, actor.Y + 5
(actor.X - 1: this will place it one pixel off of the left side of the actor.)(actor.Y + 5: this is just to place the pixel checker a little lower than the top of the actor.) But for placing the right side, it will be harder. You will have to find the width (in pixels) of your actor, and add 1 to that #, what that will do is put the checker one pixel past the furthest right point of your actor. But then you will have to check if your costumes will interfere with the checker.