Playfield Questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Playfield Questions

Steve Thomas
In the Playfield's Viewer -> Category: playfield

mouse's X  and mouse's Y
QUESTION: Is this the mouses position in relation to the "Playfields" origin?

Please help me distinguish
  • Playfield:Viewier->Category:collections->graphic at cursor
  • Playfield:Viewier->Category:playfiled->graphic
It seems the "Playfield:Viewier->Category:playfiled->graphic which can be set via Halo:Paint Background and via assignment in a script is meant to be a "Background"
  • That makes sense to me but here is my concern/lack of understanding . . .
    Why is it when I add a Background Image, the Playfield:Viewier->Category:collections->graphic:count Increases?
  • IE, If I try and iterate through the items in the Playfield with the cursor and there is a background, I will get the background sketch as the first item in the list. 
  • I would think the "Background Sketch/Graphic would not be part of the "Collection".
I created a Etoys project to test this go to page 2 of Fun With Playfields (its a work in progress, suggestions welcome).
Stephen


_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Playfield Questions

Scott Wallace
On Dec 7, 2009, at 6:00 PM, Steve Thomas wrote:

> In the Playfield's Viewer -> Category: playfield
>
> mouse's X  and mouse's Y
> QUESTION: Is this the mouses position in relation to the "Playfields" origin?

Yes.  If the Playfield's "origin-at-center" option is set, then the center of the playfield is considered the origin; otherwise the bottom-left corner of the playfield is considered the origin.  A Playfield's "mouse x" and "mouse y" are reported in relation to whichever origin is in force.


> Please help me distinguish
> • Playfield:Viewier->Category:collections->graphic at cursor
> • Playfield:Viewier->Category:playfiled->graphic

The value of a Playfield's "graphic at cursor" is a graphic (picture) of the object inside the Playfield corresponding to the current "cursor" value of the Playfield.  Thus, if the Playfield's cursor is currently 2, then the Playfield's graphic-at-cursor will be the graphic of the second object within the Playfield.

The value of a Playfield's "graphic" is the graphic of the background sketch associated with the playfield, if it has one; if not -- well, surprisingly, it yields a solid-gray graphic the same size as the playfield.  This seems like a bug to me, but anyway that's what it currently does.


> It seems the "Playfield:Viewier->Category:playfiled->graphic which can be set via Halo:Paint Background and via assignment in a script is meant to be a "Background"
> • That makes sense to me but here is my concern/lack of understanding . . .
> Why is it when I add a Background Image, the Playfield:Viewier->Category:collections->graphic:count Increases?
> • IE, If I try and iterate through the items in the Playfield with the cursor and there is a background, I will get the background sketch as the first item in the list.
> • I would think the "Background Sketch/Graphic would not be part of the "Collection".
> I created a Etoys project to test this go to page 2 of Fun With Playfields (its a work in progress, suggestions welcome).

You're right that from a user's point of view, the sketch inside the Playfield which serves as the "background picture" probably wouldn't be thought of as one of the elements inside the Playfield, but rather as something special.  However, in the etoys system at present, the "count" variable always tells the literal truth, and since a background sketch *is* one of the subparts (internally "submorphs") of the playfield, it's included in the count.

  -- Scott_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland