[etoys-dev] Need a Text Object I can set text in and have a
MouseDown Script work
K. K. Subramaniam
kksubbu.ml at gmail.com
Wed May 19 06:49:07 EDT 2010
On Wednesday, May 19, 2010 02:04:01 pm Steve Thomas wrote:
> So I wanted a way to put N items in a holder and have a script that set the
> text values of each item
> based on it's cursor position (aka element number, they always seem to be
> the same, are they?)
> and then as each element is a sibling I can simply have a script that sets
> a particular value in the expression.
You could use a holder for the number grid and drop Text siblings into it. Add
a script to the holder to set numeric value of each player at cursor to
cursor's value. E.g.
Holder setIndex (ticking on):
Holder's cursor increase by 1.
(Holder's player at cursor) numeric value <- Holder's cursor.
To get the second line, drop "Text's numeric value" tile into the script and
then replace Text's with Holder's player at cursor tile. Now each Text Object
will display its ordinal in the Holder. You may want to turn off 'indicate
cursor' it Holder's playfield options.
HTH .. Subbu
More information about the etoys-dev