Starting the clock...
Bob Arning
arning at charm.net
Fri Aug 30 18:20:58 UTC 2002
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 at 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 at 0 to: 400 at 400 width: 6 color: Color yellow.
aiworld changed.
World displayWorldSafely. (Delay forSeconds: 1) wait.
f getCanvas line: 400 at 0 to: 0 at 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 at 400; openInWorld.
aiworld addMorph: (RectangleMorph new position: 100 at 100).
aiworld addMorph: (EllipseMorph new position: 200 at 200).
aiworld imageForm inspect. "<--your ai could 'read' this form to see wwhat's happening"
=============
Cheers,
Bob
More information about the Squeak-dev
mailing list
|