LWFKit 0.1.0

LWFKit 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.



LWFKit 0.1.0

  • By
  • yonekawa

LWFKit is a framework to using LWF on your Objective-C project powered by Ejecta.

Setup

  1. Import LWFKit directory into your project.
  2. Add linked frameworks and libraries
    OpenGLES.framework, CoreText.framework, CFNetwork.framework, QuartzCore.framework SystemConfiguration.framework, libstdc++.dylib, libicucore.dylib, LWFKit/Externals/libJavaScriptCore.a
  3. Add files to Copy Bundle Resources
    LWFKit/Externals/Ejecta/EJCanvas/2D/Shaders/* LWFKit/Externals/Ejecta/Ejecta.js LWFKit/Scripts
  4. Add "$(SRCROOT)/LWFKit/Externals" into Header Search Path

How to Use

Initialize

- (void)viewDidLoad
{
    [super viewDidLoad];

    LKView *lwf = [[LWView alloc] initWithFrame:CGRectMake(0, 0, 100, 80)];
    [lwf load:@"example.lwf" completed:^ {
        NSLog(@"loaded");
    }];
    [self.view addSubView:lwf];
}

Timeline Control

// Go to jump frame
[lwf gotoAndPlayWithFrameLabel:@"jump"];

// Go to frame of 10
[lwf gotoAndPlayWithFrameLabel:10];

// Stop timeline
[lwf stop];

Event Handling

You can receive notify from flash event by fscommand.

// Notify from fscommand('event', 'foo');
[lwf addEventListener:@"foo", handler:^{
    NSLog(@"foo fired").
}];

License

MIT License

References

LWF
Ejecta