logo       

Re: Starting the clock...: msg#01378

lang.smalltalk.squeak.general

Subject: Re: Starting the clock...

Alan,

What I'm not clear on is the relative importance to your project of
- the bitmap-like qualities of an ImageMorph
vs.
- the world/container qualities of a PasteUpMorph

If it is the former, here is an example of how you can have a Form on the
screen, make changes to it and see those changes.
=============
f _ Form extent: 400@400 depth: 32.
f fillColor: Color red.
aiworld _ ImageMorph new image: f; openInWorld.
World displayWorldSafely. (Delay forSeconds: 1) wait. "so you can see each
change happen"


f fillColor: Color green.
aiworld changed.
World displayWorldSafely. (Delay forSeconds: 1) wait.

f getCanvas line: 0@0 to: 400@400 width: 6 color: Color yellow.
aiworld changed.
World displayWorldSafely. (Delay forSeconds: 1) wait.

f getCanvas line: 400@0 to: 0@400 width: 6 color: Color blue.
aiworld changed.
World displayWorldSafely. (Delay forSeconds: 1) wait.
=============

If it is the latter, the you might try something like this
=============
aiworld _ PasteUpMorph new extent: 400@400; openInWorld.
aiworld addMorph: (RectangleMorph new position: 100@100).
aiworld addMorph: (EllipseMorph new position: 200@200).
aiworld imageForm inspect. "<--your ai could 'read' this form to see
wwhat's happening"
=============

Cheers,
Bob




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

News | FAQ | advertise