[Openmcl-devel] Core Animation demo

Neil Baylis neil.baylis at gmail.com
Wed Jul 8 14:41:40 UTC 2009


>
> The image you've attached (which is quite striking by the way) seems
> to me to cry out for NSBezierPath.

Yes, exactly.

> If you mean to use Core Animation,
> you could have a tile class and a path class.

Yes, I want to be able to draw a tile as a chunk of vector art,  
(perhaps importing from an .svg representation). But in addition, I  
want to be able to draw a tile using a bitmap image, from a photograph  
of an actual tile or other real-world object.

I want to use Core Animation as part of the UI to facilitate placement  
of individual tiles in the image. I also want to be able to express  
spatial relationships between them (e.g. above, beside, parallel-to,  
etc.). I may be able to use the Core Animation constraints to do this,  
but am not sure they will be powerful enough. I will also want to be  
able to express symmetries & patterns, e.g. wallpaper groups. Inkscape  
has a facility for this, but I find it very awkward to use, so I'm  
looking to make a UI that's more intuitive.

> Many tile instances
> could share the same path instance since it is the layer of each tile
> that would be scaled, rotated, transformed, etc. not the bezier path
> itself (if I'm understanding the Apple docs correctly).

Yes, this is the most common use case, I think. The same applies to  
bitmapped tiles. Each one is repeated many times in the image. They  
are rarely scaled, but often rotated & translated. It would be nice if  
I could change a property of the master tile, e.g. stroke color, and  
have it apply to all clones of that tile automatically.

I think before I go much further, I should do a test with a large  
number of sprites, and get hit testing working so I can pick one (or a  
group) to have some operation performed. Inkscape does this without  
the benefit of Core Animation or OpenGL, and the performance suffers  
with a large number of objects. I also need to get zoom in/out,  
fullscreen switching, and a few other important UI tricks working.

Neil



More information about the Openmcl-devel mailing list