maximile
2008.09.04, 09:05 PM
You might know about a web framework called Cappuccino (http://cappuccino.org/) which is pretty much Cocoa for the web - Objective-J and AppKit and most of the important (and relevant) classes. I didn't pay much attention until recently, but you have to check out the Hello World tutorial (http://cappuccino.org/learn/tutorials/starter-tutorial.php) if you haven't already - it's almost completely compatible with Objective-C. I didn't realise how similar it could be.
It works on all major browsers. For a demo of how it could be applied to a game, check out the Puzzle (http://cappuccino.org/learn/demos/puzzle/). And to see how complex it can get, have a look at 280 Slides (http://280slides.com/).
This won't interest everybody, but it's just made the web a thousand times easier for Objective-C developers to get into, and I know there are more than a few here.
Edit: Here, look at some source:
import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotificatio n)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
[label setStringValue:@"Hello World!"];
[label setFont:[CPFont boldSystemFontOfSize:24.0]];
[label sizeToFit];
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
[label setFrameOrigin:CGPointMake((CGRectGetWidth([contentView bounds]) - CGRectGetWidth([label frame])) / 2.0, (CGRectGetHeight([contentView bounds]) - CGRectGetHeight([label frame])) / 2.0)];
[contentView addSubview:label];
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
}
@end
Feels pretty comfortable.
It works on all major browsers. For a demo of how it could be applied to a game, check out the Puzzle (http://cappuccino.org/learn/demos/puzzle/). And to see how complex it can get, have a look at 280 Slides (http://280slides.com/).
This won't interest everybody, but it's just made the web a thousand times easier for Objective-C developers to get into, and I know there are more than a few here.
Edit: Here, look at some source:
import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotificatio n)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
[label setStringValue:@"Hello World!"];
[label setFont:[CPFont boldSystemFontOfSize:24.0]];
[label sizeToFit];
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
[label setFrameOrigin:CGPointMake((CGRectGetWidth([contentView bounds]) - CGRectGetWidth([label frame])) / 2.0, (CGRectGetHeight([contentView bounds]) - CGRectGetHeight([label frame])) / 2.0)];
[contentView addSubview:label];
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
}
@end
Feels pretty comfortable.