actor child/parent problem w. r g b

Non-platform specific questions.

actor child/parent problem w. r g b

Postby sonicfire » Tue Nov 14, 2006 11:37 am

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?
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Postby Novice » Tue Nov 14, 2006 11:45 am

Don't parent them just use
Code: Select all
bar.x=player.x;
bar.y=player.y+"offset you want";
in draw actor.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby makslane » Tue Nov 14, 2006 12:53 pm

Or make the view parent of hud elements.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby sonicfire » Tue Nov 14, 2006 1:09 pm

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? :?
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Postby makslane » Tue Nov 14, 2006 9:26 pm

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!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby sonicfire » Thu Nov 16, 2006 10:15 am

Will give that a go. Thank you! :D
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest