Fwd: mailling squeak fé passé !merci

Hans-Martin Mosner hmm at heeg.de
Tue May 24 17:05:07 UTC 2005


François THIMON wrote:
> I have a morphic-problem :
> 
> I created a robot-morph, with two eyes (submorphs) and I need to find the
> coordinates of the center of my eyes in the playfield (in order to find
> distance between my eyes and others morphs of the playfield).
> 
> When heading=0, I use 'self x at self y' to find this point, and it work well, but
> when my robot's heading is different from 0 it dont match, maybe because the
> referencePosition is 'wrong' (it's a kind of offset).
> 
> So how can I find the true submorphs center coordinates when the owner got a
> transformationMorph on him?

Use "myMorph localPointToGlobal: myMorph center" to get the point within the world.
Works for other local coordinates as well :-)

Cheers,
Hans-Martin



More information about the Squeak-dev mailing list