Skip to content

Instantly share code, notes, and snippets.

@nickjs
Created September 29, 2008 00:54
Show Gist options
  • Save nickjs/13521 to your computer and use it in GitHub Desktop.
Save nickjs/13521 to your computer and use it in GitHub Desktop.
@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