I was playing around with Quartz Composer (found in the Developer Tools) recently and trying to get it work with Obj B. In a book I was reading, the author stated you can use Quartz composition as visualization to enrich the user interface. But with QCViewer you have the ability to control the composition via your program:
- Code: Select all
Event AwakeFromNib()
' Log(theQCView.loadCompositionFromFile("/Users/HU/Desktop/ObjectiveBasic/quartz composition/helloWorld2.qtz"))
Log(theQCView.loadCompositionFromFile(NSBundle.ResourcePath() & "/helloWorld2.qtz"))
theQCComposition = theQCView.loadedComposition()
Log(theQCComposition)
Log(theQCComposition.inputKeys())
Log(theQCView.valueForInputKey("backColor"))
Log(theQCView.setValue(LightGrayColor, forInputKey := "backColor"))
Log(theQCView.setValue(NSBundle.ResourcePath() & "/humble bee.JPG", forInputKey := "imageLocation"))
theQCView.setValue(theYKnob.SingleValue, forInputKey := "yRotation")
theQCView.setValue(theXKnob.SingleValue, forInputKey := "xRotation")
theQCView.setValue(theZKnob.SingleValue, forInputKey := "zRotation")
End Event
The result looks like this:
It's not static, but really ticking away the seconds while you watch it (so give it a run on your computer). Behind the digits you can see a background image shining through. You can easily change this to something more suitable for you by modifying the imageLocation key. If you move the dials you can tilt the digits around x-,y- and z-axis respectively.
Here comes the project:
The heavy lifting is done in helloWorld2.qtz, which looks like this in Quartz Composer:
I would like to read from you if it works on your computer as well.
Regards
Udo