[Squeakland] pen trail as object (in OLPC)

Dreyfuss Pierre-André (EDU) pierre-andre.dreyfuss at edu.ge.ch
Sat Sep 8 14:37:06 PDT 2007


There is an other solution.
Use a lineMorph instead of penTrail.


Get object catalog from box flap.
Get a line in category graphics.

get an ellipse

The line has a category polygon in the script viewer
You'll find there all you need for creating a new vertex, putting it at the position of the ellipse.
move the ellipse and create a new vertex, put it at the position of the ellipse ... and so on 
 The line is the wanted object and has the wanted shape !

Here are the scripts  for getting a circle.


Player118 -- 1 instance, nommé Ligne
Player119 -- 1 instance, nommé Ellipse


--------------------------------------------------------------------------------------------
Ligne. scripts :

Ligne.newposition
	self appendVertex.
	self setVertexCursor: self getVerticesCount.
	self setXAtCursor: Ellipse getX.
	self setYAtCursor: Ellipse getY

Ligne.init
	self removeAllButCursor.
	self setXAtCursor: Ellipse getX.
	self setYAtCursor: Ellipse getY
--------------------------------------------------------------------------------------------
Ellipse. scripts :

Ellipse.script1
	self forward: 5.
	self turn: 5.
	Ligne newposition


Download the project:
http://ofset.org:8000/super/uploads/lineTrack.002.pr

Regards.



-------- Message d'origine--------
De: squeakland-bounces at squeakland.org de la part de Randy Heiland
Date: jeu. 06/09/2007 02:06
À: Squeakland list
Objet : [Squeakland] pen trail as object (in OLPC)
 
I was revisiting this issue - wanting to have my drawn pen trail  
become an object, and I dug up this post:
http://article.gmane.org/gmane.comp.lang.smalltalk.squeak.squeakland/869

Are these directions still basically true for the OLPC etoys, i.e. do  
I need to resort to writing a textual script?

thanks, Randy






More information about the Squeakland mailing list