PrEV
Thoughts from a NeXTStep Guy on Cocoa Development

CATiledLayer Example

Jun 13, 2008 by Bill Dudney

One of the examples I put off until I had to do it was CATiledLayer. Basically the docs were not very complete so I was hoping that by the time I really needed them I'd have better docs. Well the docs never materialized but I had 2 or 3 errata about the lack of an example so I figured I'd get off my back side and get something done. I did an example that will make it into the book. It is on drawing png's with multiple versions of the image that are drawn depending on the scale factor, its cool you will like it :).

In the mean time there were still a few things that seemed like I did not grok. So, I went to the CA lab time while out here at WWDC (besides networking that is the other 'coolest thing' about being here). After spending some quality time with the folks in the lab I think I finally have the tiled layer nailed.

I've uploaded the example here.

The example shows a delegate doing all the drawing (which is drop dead simple) and the view setting up the layers. The thing I had wrong in my head was related to levelsOfDetail and levelsOfDetailBias. Levels of detail determines the # of levels of detail (seems obvious doesn't it...) and the bias determines how many are 'reserved' for zooming in. So if you set the levels of detail (LOD) to 4 and the bias to 1, you'd get 2x zooming in (2^1) 'native zoom' (2^0), 2x zoomed out (2^-1) and 4x zoomed out (2^-2). If you set the LOD to 8 and the bias to 5 you'd get 32x zoomed in (2^5) to 4x zoomed out (2^-2). Hope that makes sense, if not feel free to ping me.

Happy animating...

Permalink     8 Comments - Add Yours

Meeting people is key @ WWDC

Jun 13, 2008 by Bill Dudney

Yesterday I was chatting with Mike and Jonathan when someone in a mic head set said, hey would you guys like to be on a pod cast. I, being the ham I am, jumped up and said Sure!

Turns out the guy in the head set was Lee Givens of the Mac@AOL Blog and the podcast was from MyMac. Fantastic time, I'm hoping to do more with these guys.

Then a little later in the day I ran into Dave Batton. I first ran into Dave way back about jan or feb of last year on his blog. Reading about 'living the life' in Italy was part of my inspiration to just dump the java world and make the jump. I finally meet him face to face @ the Boulder Cocoa Heads a few months ago. Very cool. He just released a new product that looks great, go check it out.

I had lunch with Scotty. Which was great fun to put a face with the guy on the other end of that skype connection. Scotty brought along Uli Kusterer and Craig. Both really interesting guys to hang out with. I'm esp interested in the design ideas that Craig had. Great to talk to people that have an aesthetic instinct, now to integrate that into my own thinking...

And I had a late coffee with Chris. Fantastic guy building some really cool new stuff.

How cool is that! What a blast to meet folks doing creative and fun stuff seemingly randomly. I love this show.

I also saw some amazingly fantastic demos of some really cool technology... But I can't say more (or probably even that) but as always its going to be a great ride over the next 18 months.

Permalink     1 Comment - Add Yours