You should be using Core Animation for this. You should create a transparent view/window that's large enough to contain your whole animation. You should then use CALayer
objects to perform the actual animation.
Core Animation layers are essentially high-level lightweight wrappers around OpenGL surfaces and the rendering of the layers is done by the GPU, giving much better performance than CPU-managed animation such as NSViewAnimation
.
Bear in mind that because Core Animation layers are lightweight, they don't have any event-handling built into them, so you'll need to do all the mouse tracking in your view/view controller.
Your other option is using layer-backed views (which have their own CALayer
) and animating the buttons' positions using the animator proxy. This may be enough to achieve what you want, and because the buttons are still full NSButton
objects they still have all the NSView
event handling.
You should probably read the Animation Overview to give you a better idea of how all these technologies work.