[squeakland] point towards the mouse?
p.a.dreyfuss at excite.com
p.a.dreyfuss at excite.com
Wed Nov 11 04:39:39 EST 2009
Hi,Bill
You'll find the tiles mouseX and mouseY in the playfield category of a playfield or of the world.
get an arrow fom object catalog/graphics
move the ble rotation handle sligtly to make te center or rotation visible and move it shift/drag to the foot of the arrow.
get the viewer of the arrow category polygon, et the arrow's vertex .cursor to 2 (head of the arrow).
now just build the tiles :
arrow's x at cursor _ playfield's mousex
arrow's y at cursor _ playfield's mousey
You probably just need to find where the tiles mouse and mousey were lying, but this will help other people.
Regards
-----Original Message-----
From: "Hilaire Fernandes" [hilaire.fernandes at edu.ge.ch]
Date: 11/11/2009 02:51 AM
To: "Bill Kerr" <billkerr at gmail.com>
CC: "squeakland.org mailing list" <squeakland at squeakland.org>
Subject: Re: [squeakland] point towards the mouse?
You may have to write something like that
script1
self
setHeading: (self costume referencePosition bearingToPoint:
ActiveHand x @ ActiveHand y)
This example does not work yet, but you get the idea.
Hilaire
2009/11/11 Hilaire Fernandes <hilaire.fernandes at edu.ge.ch>:
> For point 2., you may have to write the script in Smalltalk mode then
> use the code
>
> ActiveHand x to get abscissa of the mouse pointer
>
> Hilaire
>
>
> 2009/11/11 Bill Kerr <billkerr at gmail.com>:
>> 1) Is it possible to get an arrow to point towards the mouse pointer in
>> etoys?
>> I can get it to point towards a box which is being moved with the mouse with
>> this script: arrow's heading <-- arrow's bearing to box
>> In the world menu in the playfield pane there are mouse x and mouse y
>> detectors but arrow's bearing will not accept those detectors as input to
>> replace just the box part
>> 2) I also wanted to detect a mouse click but can't see any way to do that.
>> The input pane in the world menu detects last keystroke but not a mouse
>> click.
>> _______________________________________________
>> squeakland mailing list
>> squeakland at squeakland.org
>> http://lists.squeakland.org/mailman/listinfo/squeakland
>>
>>
>
>
>
> --
> http://blog.ofset.org/hilaire
>
--
http://blog.ofset.org/hilaire
_______________________________________________
squeakland mailing list
squeakland at squeakland.org
http://lists.squeakland.org/mailman/listinfo/squeakland
------------------------------------------------------------
Earn your MBA from Regis University, 100% online. Free info packs!
Regis University MBA
http://tagline.excite.com/c?cp=LfMTzzmeOE8zCBI7sFDD9wAAKZToN1182YPvy_lW2lk3BQ_8AAQAAAAFAAAAAArTqj8AAAMlAAAAAAAAAAAAAAAAAAiHkMOdOVw=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakland.org/pipermail/squeakland/attachments/20091111/ca498b25/attachment.html
More information about the squeakland
mailing list