[Newbies] Porting BallonMorph to Processing (Java)

Werner Gaisbauer werner.gaisbauer at gmail.com
Sun Aug 12 10:14:00 UTC 2012


I really like the BallonMorph of Squeak (aka tooltip) and would like to port it to another programming language. But I’m a newbie in Smalltalk and Squeak so I’m having a hard time understanding e.g. the getVertices method. As far as I understand this method creates the vertices of the polygon that is the speech bubble?

It would really help me if someone could post this method in e.g. Java (my goal is to port BalloonMorph to Processing - see http://www.processing.org/) or give me some hints on how to read it.

Here is the method:

getVertices: bounds
	"Construct vertices for a balloon up and to left of anchor"

	| corners |
	corners := bounds corners atAll: #(1 4 3 2).
	^ (Array
		with: corners first + (0 - bounds width // 2 @ 0)
		with: corners first + (0 - bounds width // 4 @ (bounds height // 2))) , corners

Thanks for helping,

Werner Gaisbauer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20120812/334ac9f9/attachment.htm

More information about the Beginners mailing list