logo       

Re: Moving an object inside another object with respective to cursor positi: msg#00132

lang.smalltalk.squeak.beginners

Subject: Re: Moving an object inside another object with respective to cursor position

On Nov 18, 2006, at 2:54 , mnrao wrote:


hi all,
I have created an rectangle morph and a small ellipse morph. I want
to place the ellipse in the rectangle and move the small ellipse (circle) in
the direction of the mouse pointer. I want the small ellipse does not come
out of the rectangle but small ellipse should be moving with respect to
direction of the mouse just as movingeyemorph making the ellipse stay at one
place move with in the direction of mouse .can anyone help me make this
happen

You can access the x and y of the mouse pointer in the world's viewer. You have access to the x and y and width and height of the rectangle, as well as to the width and height of the ellipse. You can move the ellipse by setting its x and y. Other than that, it's just some math.

- Bert -


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise