Draw actor and create actor: whats the differences?

Talk about making games.

Draw actor and create actor: whats the differences?

Postby duracel92 » Thu Jun 08, 2006 3:45 pm

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
duracel92
 
Posts: 132
Joined: Sat Jan 21, 2006 10:45 pm
Location: UK
Score: 0 Give a positive score

Postby Novice » Thu Jun 08, 2006 4:06 pm

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.
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 Just4Fun » Thu Jun 08, 2006 4:41 pm

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:
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest