Wednesday 12 May 2010

Selecting the cupcakes - Depth of field

When the user selects a cupcake case from the shelf in the kitchen, I wanted the case to scale larger to have the appearance that it was coming towards you.

1. Actionscript was used to first define the width and height of the cases. This is so that if the case was dropped on stage it would snap back to its current size.

2. Each case is defined as .this, using the variable .this constitues to anything the mouse is clicked on.

3. The script first starts by saying if the cupcake case is clicked and it is moved more than 74 pixels on the Y axis to scale the case by its original size divided by 2.

Image 1: The blue cupcake case is selected and is noticably bigger than the original pink cupcake case.


Image 2: The blue cupcake case gets bigger as it gets closer to the baking tray.

Image 3: The case keeps its shape when placed on the baking tray by defining its X and Y coordinates to 94 pixels.





No comments:

Post a Comment