Droppable Behaviors in Etoys

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

Droppable Behaviors in Etoys

Steve Thomas
I am looking to create droppable behaviors similar to those in Lively Kernal.  I can do it with connectors like this:
script1
self getDestinationPlayer setColor: self getSourcePlayer getColor

But would like to simply drop a morph onto another morph to accomplish the task.  How can I get a list of morphs my "droppable behavior" is overlapping?

Extra points for a sample project :)

Thanks,
Stephen 

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

Re: Droppable Behaviors in Etoys

K K Subbu
On Thursday 09 Feb 2012 7:07:17 AM Steve Thomas wrote:
> I am looking to create droppable behaviors similar to those in Lively
>
> Kernal.  I can do it with connectors like this:
> > script1
> > self getDestinationPlayer setColor: self getSourcePlayer getColor
>
> But would like to simply drop a morph onto another morph to accomplish the
> task.  How can I get a list of morphs my "droppable behavior" is
> overlapping?
You can use Morph>>morphAt:behind:unlocked: method to get a list of morphs
that lie below a morph at the given position.

The embed menu op uses this to extract a list of morphs. See
Morph>>potentialEmbeddingTargets and its callers for examples.

HTH .. Subbu
_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev