[Squeakland] Re: Etoys: using holders as arrays
voiklis at redfigure.org
Fri Aug 29 16:53:48 PDT 2003
Thank you Scott for the thorough explanation and contextual information,
and especially for the sample projects. I hope my tutorials prove half as
helpful for people.
On Thu, 28 Aug 2003, Scott Wallace wrote:
> >Hmmm; that's too bad. I was hoping there was some way to read the numeric
> >value of Number (bare).
> You *can* obtain the numeric value of an object that bears one, by
> asking for its "numericValue", which you'll find in the "basic"
> category of the object's Viewer. (Unfortunately, some objects that
> can bear a numeric value, such as the "Number (bare)" and its
> confreres found in the Basic-1 category of the Objects catalog, are
> not set up for use with etoy -- see PS below.)
> For example, in the "NumericValue" project (recently placed on the
> Squeakland BSS,) an arrow is scripted to move forward at a speed
> obtained from the "speed-slider" object and to turn by an amount
> obtained from the "angle-slider." Here is a picture of the objects
> and scripts in this project:
> Similarly, you can get and set the numericValue of any "text" object.
> In the "squarer" project, also just placed on the Squeakland BSS,
> the pink "its square" box is scripted to compute the square of the
> number you type in to the green box:
> See also Diego Gomez Deck's beautiful "Spirograph" example, also on
> the Squeakland BSS.
> -- Scott
> PS: The "Basic-1" and "Basic-2" categories of the Objects catalog
> were added latterly to Squeak as part of an unfinished effort outside
> the framework of e-toys -- that's why none of the three "Number"
> objects found in Basic-1 has "numericValue" offered in its Viewer.
> This should be fixed, or else these underpowered "Number" offerings
> should be removed from the Objects catalog. For the time being,
> anyway, I suggest that people use texts and sliders to hold numbers
> they want to work with using etoys. Alternatively, manually create a
> numeric instance variable for some object, and obtain a "watcher" for
> it from the object's viewer.
More information about the Squeakland