Change opacity to an actor

MarkOnTheIronMarkOnTheIron Member Posts: 1,447
edited November -1 in Working with GS (Mac)
I want to make a rule that allow an actor (a wall) to become partially invisible when the main actor go behind it.
Is it possible?

Comments

  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Just to complicate it more I want the wall to partially disappear when the main actor pass over a certain area and then return to normal when he leaves it.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Make a rule in the wall actor that when the main actor collides with it, change attribute: self.Color.alpha = .5. Otherwise Change Attribute self.Color.alpha = 1
    Similarly create a game attribute that when an actor is over an actor that covers your certain area in the game, that attribute is changed.

    IN THE WALL ACTOR:
    Rule: When actor receives event 'overlaps or collides' with (mainactor)
    OR
    --Change Attribute: self.Color.Alpha = .5
    Otherwise:
    --Change Attribute: self.Color.Alpha = 1

    Rule: When Attribute game.InArea = true
    OR
    --Change Attribute: self.Color.Alpha = 0
    Otherwise:
    --Change Attribute: self.Color.Alpha = 1

    IN THE AREA ACTOR:
    Rule: When actor receives event 'overlaps or collides' with (mainactor)
    OR
    --Change Attribute: game.InArea = true
    Otherwise:
    --Change Attribute: game.InArea = false
Sign In or Register to comment.