Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Fade to Color- Transitional effects
Old
Kymberlee
Guest
 
Status:
Posts: n/a
Default Fade to Color- Transitional effects - 02-12-2009, 02:13 PM

I apologize if this has been asked/answered. I am going through the book "Alice in Action" and at the end of chapter 6 it discusses transitional effects, such as fade to black, where you set a "number" parameter so the user can choose how long the fade to black should take. One of the assignments asks that you do a similar thing, only fade to "someColor"... and this is where I am not sure what to do.
When I need to do anything asking a user to input a number, such as time or distance, I use a number parameter... but what kind of parameter do I use for a color choice? Not object- then the user needs to pick an object. Not a string, then the user has to type in a string... I am lost.
I hope this makes sense, and I'm sorry if it's a dumb question- I'm new to this, and can't seem to figure it out.
   
Reply With Quote
Old
Mojax
Guest
 
Status:
Posts: n/a
Default 02-12-2009, 04:59 PM

Looking into this, I see that the shutters they use to achieve the fading are just the Square object. So if you create your method, then create a parameter, you'll notice that if you select other, one of the options in the drop down box should be color. Then you can drag in the "color=" from the Square's properties tab, and then drop the parameter in place of the selected color. Then you just need to figure out how to have the user select what color they want. That part I'm still looking into.
   
Reply With Quote
Old
Mojax
Guest
 
Status:
Posts: n/a
Default 02-12-2009, 05:23 PM

Ok, the way I did it was thusly. I created a world variable as a list of colors. So create new variable under the properties tab of world, choose other:color then check off list. Then add the colors in. Now all the colors have an "index" value in the list. So in your method for setting the color, make the parameter a number. Then you can use the "NumberDialogue(question)" for it's value to ask the user for a number of the color they want. This then gets passed to the "color=(parameter)" statement, and voila! Hope this made sense. Since I'm actually in your class (this is Jeff ) you can ask me about it if you see me.
EDIT: figured out you could attach files, so I've included an example file that shows what I mean.
Attached Files
File Type: a2w colorChange.a2w (158.6 KB, 10 views)

Last edited by Mojax; 02-13-2009 at 04:00 AM.
   
Reply With Quote
Old
Kymberlee
Guest
 
Status:
Posts: n/a
Default 02-16-2009, 11:43 AM

Thank you!!!
You ROCK.
I'm seeew dumb sometimes. Thanks for not pointing out the obvious.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.