Everyone knows how to add a UIView to an iOS app built with cocos2d-iphone. It’s straightforward, just create the view and then call:

There. Now suppose you want to do the same on Mac OS X. HA! HA! Hawww!

Cocoa’s laughing at your feeble attempts. It’s really just Cocoa’s fault though. Having done a fair amount of work with both SDKs, the Cocoa on OS X just feels … old. Backwards. Confuscated. No, not confusing, literally confuscated – it can’t even spell confusing like everyone else does.

But … there is always a way. On OS X it’s just more often than on iOS a matter of finding the right way. It can be done. Here’s proof:

The Right Way™

The trick here is to create an additional “overlay” NSWindow that’ll hold all of your views. Actually, it’s not the overlay window it’s the overlay window’s content view, which is just an empty NSView. But first things first, step by step.

Continue reading »

Tagged with:  

Apple Device Sales Statistics Q3 2012 (Including Macs)

On August 23, 2012, in idevblogaday, by Steffen Itterheim

This is an update to the last sales statistics post to include Apple’s Q2 and Q3 2012 results as well as adding Macintosh sales:

Apple Device Sales, accumulated (Q1/2007 – Q3/2012). Y Axis is in millions.

I got the Mac sales numbers from Apple’s quarterly Earnings Press Releases dating back to Q1/2007. Nearly all Macs sold from 2007 onwards are capable of running at least OS X 10.7 (Lion). The Mac numbers include both desktop (iMac, Mac mini, Mac Pro) and portable (MacBook series) machines.

This puts things in perspective from sheer numbers. There are now more iPads in the world than there are (relatively up-to-date) Macs!

On the other hand, given that most Macs cost over $1,000 the sales numbers aren’t reflecting revenue. But you can argue that making a Mac OS X (Mountain) Lion app has the potential to reach the same number of App Store users than an iPad exclusive app.

Continue reading »

I’m looking for a good Text Editor for Mac OS X that supports Lua (preferably without installing any additional files). And I also want the editor to support autocomplete (aka code completion) for the Lua language, as well as being able to extend the autocomplete keywords.

Much to my dismay this narrowed down the field quite a bit. Therefore I created this list with short (and subjective) reviews of Text Editors for Mac OS X which you may find a good extension to Wikipedia’s Comparison of text editors.

But first, I want to be sure we’re all on the same level when we talk about the autocomplete feature. This Qt Creator video with Thorbjørn Lindeijer (of Tiled Map Editor fame) shows you what this feature is all about (beginning at 0:15).

I wanted to find the text editor for Lua that suits my needs. Since there are so many text editors, I quickly dismissed those editors that didn’t support autocomplete. And those whose Lua support needs to be installed manually also took a backseat rather quickly. By all means: please do correct me where I’m wrong, inaccurate, etc. I’m also open to discussing the inception of a flame war, if deemed helpful. :)

Continue reading »

Correctly Processing Mac Keyboard Events

On September 10, 2011, in cocos2d, Kobold2D, Programming, by Steffen Itterheim

Wouldn’t it be cool if you could just check the keyboard state at any time from any class?

I’ll get to the “cool” part in a moment, first let me set the record straight on how to correctly process keyboard input in Cocos2D Mac builds:

Continue reading »

Kobold2D Meets Cocos2D-X

On June 17, 2011, in cocos2d, Kobold2D, by Steffen Itterheim

Kobold2D is well and alive. Actually so much so that I thought: “Hey, it’s crazy, but maybe not … I’ll give it a shot and see how far I get.”

The thought was to try and add the cocos2d-x engine (cocos2d in C++) together with the Hello World example project to the Kobold2D workspace. The result: it took about 90 minutes, most of that figuring out the correct build settings and header search paths. And it just worked.

Surprise! 😀

Right now this is just the iOS version. A cocos2d-x Mac project will be added as soon as the Mac platform is officially supported by cocos2d-x (or does it already and I missed that?). Then developers would have the choice between using either Objective-C or C++ as the primary language for developing their iOS & Mac OS X games.

It also made me think: “Hey, there’s this other open source 2d game engine … hmmm….” :)

Tagged with: