alice-teacher Bug with Shape Class Box

Donald Slater djslater107 at mac.com
Tue Mar 7 19:43:00 EST 2017


This is a known bug with the Box class. We are working on it now. As far as we can determine, this is happening only with the Box class.

There is a workaround.

In the Code Editor, 
select the box object
drag the procedure tile for setWidth, setHeight, or setDepth into the Editor.
if you are looking to resize the box proportionally in all directions, each of the three will behave in the same way
however, if you click on add details… and select policy, and then select PRESERVE NOTHING, the box will be resized only in the chosen dimension (PRESERVE ASPECT RATIO is the default behavior - resize in all dimensions, PRESERVE VOLUME will adjust the size of all three dimensions so that the volume of the Box remains the same)
if you click on add details… and select duration, and then select 0.0, perhaps set the code at the beginning of the program, the box will appear immediately as you would wish.
The Scene Editor has another method, performCustomSetup. Alice will execute all the commands contained in this procedure before the runtime window opens.
Click on the yellow Scene tab at the top of the Editor window. This opens the Scene class showing all the procedures, functions, and properties available to that class
You will see the procedures myFirstMethod, initializeEventListeners, and performCustomSetup listed. Click on performCustomSetup. This will open the procedures tab in the Editor.
Drag a setWidth statement of the Box into this window, and set its size value. Choose the PRESERVE NOTHING policy.
You do not need to set duration, as the code executes before it can be seen in the runtime window,
Click on Run, and the box will appear in its correct proportions when the runtime window opens.
Please let me know if any of this is unclear or if you have any other questions…

All the best,



Don Slater

Alice Project
Carnegie Mellon University
Entertainment Technology Center
700 Technology Drive
Pittsburgh, PA 15219

Email: dslater at cmu.edu

I have learned this at least by my experiment: that if one advances confidently in the direction of his dreams, and endeavors to live the life he has imagined, he will meet with a success unexpected in common hours.
--- Henry David Thoreau

The true object of all human life is play. -- G.K. Chesterton

— I apologize if the was double-posted… I do not remember see it earlier today…


> On Mar 7, 2017, at 10:13 AM, Emily Higgins <erphiggins at gmail.com> wrote:
> 
> Hello,
> One of my students discovered that if you put in a Shape class Box and resize it in scene editor (not in a method), when you run the program, the box changes back to its original size.  I've attached my code - I replicated his code on my computer - for you to see.  Anyone else have this problem?
> 
> Thank you,
> Emily Higgins
> Boothbay Region HS
> <boxBugSizing.a3p>_______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20170307/53d42a55/attachment.html>


More information about the alice-teachers mailing list