Page 1 of 1

actor child/parent problem w. r g b

PostPosted: Tue Nov 14, 2006 11:37 am
by sonicfire
i have a healthbar which has parent set to player.
(so that the healthbar always stays at the same place when moving around).

now i just applied a little "fade out" effect to the player (using r,g,b). works like a charme, the only problem is not only the player gets faded out but also the healthbar! (i assume thats because its a child of the player actor).

But: How can i get rid of this? I only want the player actor to be faded out, not the HUD elements, of course.

I cant temporary remove the relationship since then the HUD wouldn´t move with the player anymore ... :?

Any solutions / ideas?

PostPosted: Tue Nov 14, 2006 11:45 am
by Novice
Don't parent them just use
Code: Select all
bar.x=player.x;
bar.y=player.y+"offset you want";
in draw actor.

PostPosted: Tue Nov 14, 2006 12:53 pm
by makslane
Or make the view parent of hud elements.

PostPosted: Tue Nov 14, 2006 1:09 pm
by sonicfire
makslane wrote:Or make the view parent of hud elements.


thanks! tried this, but it´s still the same problem. perhaps because of view is child of player actor? hmm!

seems to me that i have to use the x/y method again? :?

PostPosted: Tue Nov 14, 2006 9:26 pm
by makslane
If the player is parent of view, try use skins actors:

1) Create your player actor
2) Use this actor to control all events and actions
4) On 'Create Actor' event, put the action 'VisibleState' with option 'Don't draw, but allow events'
3) Put the movement animations (left, right, ...), but can the same image for all (remember, this actor don't will be shown)
4) Create the skin actor
5) Change the option 'Inherit events from' player
6) Put the real animations here with tha same name given on player actor
7) On 'Create Actor' event, put the action 'VisibleState' with option 'Enable'

Now, you can just change the visible aspect your player by changing the skin.
So, you can control the actions in the player and have several skins by using several skin actors.

Look the example:
http://game-editor.com/examples/skin.zip

In this example, hud parent's is the view actor, and the view's parent is the player.
The skin have 50% transparency and don't affect the hud!

PostPosted: Thu Nov 16, 2006 10:15 am
by sonicfire
Will give that a go. Thank you! :D