How do I prevent the color of my actor of bleeding through my image?
gfb08174
Member, PRO Posts: 69
I have white and black actors, the colors of which I cannot change because they are key to the scene. Both have to animate an identical orange image, however, once the image animates in both, the original orange image fades significantly, rendering the image very dark in the black actor, and very pale in the white actor. Changing the alpha of both actors means they are no longer black and white.
How can I lock the translucence of the orange image in order for it not to change? Or alternatively, how do I ensure the color of an actor doesn't affect the image?
Comments
How can lock the translucence of the orange image in order for it not to change?
Mysterious question of the week
@Socks I'm not sure what you mean with that.
What I'm wondering is whether it is possible to reproduce an image inside of a colored actor in order for that image to appear as it usually would, regardless of the actor's background color.
@gfb08174 One solution would be to save the images as png files with the alpha at 50 percent. Then simply attached them to a white actor in GS. You can easily do this in Photoshop.
Also you can also spawn a new black actor in place of the one animating after it's animation is complete. The user would never know.
Big Smile Games Play Happy!
Check out our other GameSalad exclusives.
I mean that the question was very mysterious / difficult to understand.
No, the actor will add (technically multiply) its colour to the image colour, only a white actor will leave the image unchanged.
Is there a reason that you are changing the background color from white?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@Socks so from what you're saying, it's impossible for my picture to remain as it is, unaffected by the background color.
@tatiang yea. In this particular scene of the game the different colors are essential.
No, it's not impossible, using a white actor will leave your image uneffected.
@gfb08174 I think this is one of those situations where a couple of images would be better at explaining what exactly your trying to achieve... and the results your not getting...
@Chunkypixels you're right! It's a bummer that I'm not by the computer that has my project on it.
I'm creating a memory game where you are flashed a color sequence. You then have to guess the sequence correctly by clicking on the tiles of the corresponding colors.
e.g.
a text says: red, purple, pink, brown, etc etc
when the text disappears, you have to guess the sequence by clicking on the tiles of the corresponding colors (the tiles are red, purple, pink, brown, etc actors)
In the event you forgot the sequence and clicked on the wrong color, a change image attribute is triggered, which makes it clear to you that you made a mistake.
Here lies the problem. The image which is triggered upon making a mistake is always the same, however, since all these different actors are colored differently, the image itself appears discolored. If you were to erroneously click on the red actor, the image appears reddish, if you erroneously clicked on the purple actor, the image appears purple-ish, etc.
What I need therefore, is for the image to look the same across the board, no matter the color of the actor.
I would recommend using an image for each colored actor. So for the red tile actor, make its image a red square but set the actor background color to white.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang that's what I ended up doing
@tatiang although I resolved this issue, it's been on my mind all week. How would one resolve this issue if the actor displayed a number or word/letter instead of just a color? Would one have to do the same thing?
If you use a Display Text behavior to display a number or word/letter then you could use the built-in actor colors or an image that already has the color as with my earlier suggestion. Display Text is overlaid and doesn't have the "see through" issue.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang I now realize the phrasing of my question is unclear.
Imagine you had an actor, that actor had a display text attribute which displayed a word/letter/number. Let's say a word in this case.
Within the actor that is displaying the word, you create a rule that says e.g. when game.pagenumber = 2 display image "xyz".
If you were to tap the actor containing the word on page 2, the word would appear above image XYZ, which is displayed below the word.
In other words, how could you momentarily remove the word in order for image XYZ to momentarily appear without being obstructed by the word?
You'd have to use a rule that says When [some condition], Display Text "xyz". When that condition was false, it would no longer display anything.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang
"xyz" would have to always be displayed except when its actor flashes the correct/incorrect image when clicked. Is is only then when the text would momentarily disappear.
It would basically be the same scenario I outlined above, but instead of coloring the actors they would be labeled with a number/letter. As far as I have tried, the display text attribute cannot be momentarily hidden while the correct/incorrect image flashes.
@tatiang album attached.
In first photo how actor appears with display text. In second photo how actor appears when image is animated upon click. The text does not disappear.
http://imgur.com/a/aGNZl
How did you set up the rule?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
display text XYZ
rule when touch is inside and when game.pagenumber = 1
- timer for 5 seconds -
- (animate arrow) -
rule when touch is inside and when game.pagenumber =/= 1
- timer for 5 seconds -
- (animate another arrow) -
both timers with run to completion checked.
So the Display Text is not inside of a rule? It needs to be.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
No, its not inside a rule
I'm having difficulty with a rule I created for changing a page when clicking on an actor.
I created a rule:
When touch is inside and when game.pagenumber = 4,8
change attribute game.pagenumber to game.pagenumber +1
With 4,8 I mean to say, that the condition can be true on both page 4 and page 8.
This doesn't work when the page's number is 8. I tried with the comma, " ", ( ) and .. but nothing works.
How can I put multiple page numbers in one and the same equation?
You have to make a rule with multiple conditions. In each condition, enter one of the possible values.
When touch is pressed
.....when attribute game.pageNumber=4
..............attribute game.pageNumber=8
The second (inner) rule should be set to when ANY condition is true.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
How could I integrate the text function into that rule and have it disappear when the image is spawned?
Well, you don't spawn an image, you change it.
I explained that above:
So that condition might be when self.Image is a certain value, for example.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
...
It still doesn't work.
I suspect the inclusion of the timer has something to do with it. I've spent all day fumbling around with it and number 3 comes closest to how I want it to work, but without the number showing when the smiley/sad face are showing.
http://www.mediafire.com/download/vanwx9t25n509r8/image_viewer_demo_2.1.zip
I assume you're referring to the third answer actor on the second scene.
The Display Text behavior is NOT inside of a rule. When a behavior is outside of a rule, it fires immediately. Because Display Text is a persistent behavior, it continually runs. So the fact that you don't have it inside of a rule means that '3' will always be present on the screen. If you want it to go away when you are clicking on the actor, then put it in the Otherwise section of the When Touch is Pressed rule. If you want it to go away when the actor's image is animating, consider changing a boolean value such as self.hideText to true when you click on the actor and then to false after 2 seconds (when the animation has completed) using an After timer. Place the Display Text behavior inside of a rule that says When attribute self.hideText is false.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you
Thanks for this beautiful information......