Created
September 29, 2008 00:54
-
-
Save nickjs/13521 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation AppController : CPObject | |
{ | |
CPWindow _rootWindow; | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
_rootWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask]; | |
[_rootWindow orderFront:self]; | |
var content = [_rootWindow contentView]; | |
[content setWantsLayer:YES]; | |
[content setLayer:[CALayer layer]]; | |
var view = [[SuperText alloc] initWithFrame:CGRectMakeZero()]; | |
[view setStringValue:@"Super Flash"]; [view setFont:[CPFont systemFontOfSize:24.0]]; | |
[view setAlphaValue:0.0]; [view sizeToFit]; | |
[content addSubview:view]; | |
[[content layer] display]; | |
var anim = [[CPAnimation alloc] initWithDuration:2.0 animationCurve:CPAnimationLinear]; | |
[anim setDelegate:view]; | |
[anim startAnimation]; | |
} | |
@end | |
@implementation SuperText : CPTextField | |
{ | |
} | |
- (BOOL)animationShouldStart:(CPAnimation)animation | |
{ | |
console.log('aaa'); | |
return YES; | |
} | |
- (float)animation:(CPAnimation)animation valueForProgress:(float)progress | |
{ | |
console.log('sdf') | |
[self setAlphaValue:progress]; | |
return progress; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment