Page 1 of 1

Draw actor and create actor: whats the differences?

PostPosted: Thu Jun 08, 2006 3:45 pm
by duracel92
I'm busy away trying to make GUI, I'm puzzled on which event I would use.

I'd like to know what the differences are between them, and what the pros and cons of them....

Thanks

PostPosted: Thu Jun 08, 2006 4:06 pm
by Novice
Draw actor events hapen each time the sreen redraws (depending on your setting, default is about 30 times/s).
Create Actor events hapen only when an actor is created. In the case of the view actor it hapens only once.
There are no pros and cons to them, you use them in diferent cases, deppending on the result you wish to achieve. So if you need to initiaize a variable you do it in create actor but if you need to check something constantly use draw actor etc.

PostPosted: Thu Jun 08, 2006 4:41 pm
by Just4Fun
duracel:

Try this within GE to see the two functions in action:

1. Create two actors (oneTime & roulette). Make them text Actors and enter 0 in the text field.
2. Within the actor 'oneTime', use the createActor function --> script editor. Now use the following code:

int i = round(rand(6)+1);
oneTime.textNumber= i;

3. Within the actor 'roulette', use the drawActor function --> script editor. Now use the following code:

int i = round(rand(6)+1);
roulette.textNumber= i;

Run the program... :lol: