Latest 0.1.0
Homepage https://github.com/yonekawa/lwfkit.objc
License MIT
Platforms ios 5.0, requires ARC
Frameworks OpenGLES, OpenAL, CoreText, CFNetwork, QuartzCore, SystemConfiguration
Authors

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

Setup

CocoaPods

  1. Add LWFkit into your Podfile
  2. pod install

Manually

  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 = [[LKView alloc] initWithFrame:CGRectMake(0, 0, 100, 80)];
    [lwf load:@"example.lwf" completed:^ {
        NSLog(@"loaded");
    }];
    [self.view addSubView:lwf];

    // load with data prefix
    [lwf load:@"example.lwf" prefix:@"data/example.lwfdata" completed:^ {
        NSLog(@"loaded");
    }];
}

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 addEventHandler:@"foo", handler:^{
    NSLog(@"foo fired").
}];

License

MIT License

References

LWF
Ejecta

Latest podspec

{
    "name": "LWFKit",
    "version": "0.1.0",
    "summary": "Lightweight SWF framework for your Objective-C project with Ejecta",
    "homepage": "https://github.com/yonekawa/lwfkit.objc",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "yonekawa": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yonekawa/lwfkit.objc.git",
        "tag": "v0.1.0"
    },
    "platforms": {
        "ios": "5.0"
    },
    "source_files": "LWFKit/Views/*.{h,m}",
    "vendored_libraries": "LWFKit/Externals/libJavaScriptCore.a",
    "libraries": [
        "stdc++",
        "icucore"
    ],
    "frameworks": [
        "OpenGLES",
        "OpenAL",
        "CoreText",
        "CFNetwork",
        "QuartzCore",
        "SystemConfiguration"
    ],
    "resources": [
        "LWFKit/Scripts",
        "LWFKit/Externals/Ejecta/Ejecta.js",
        "LWFKit/Externals/Ejecta/EJCanvas/2D/Shaders/*"
    ],
    "requires_arc": true,
    "subspecs": [
        {
            "name": "JavaScriptCore",
            "source_files": "LWFKit/Externals/JavaScriptCore/*.{h}",
            "requires_arc": false,
            "header_dir": "JavaScriptCore"
        },
        {
            "name": "Ejecta",
            "source_files": [
                "LWFKit/Externals/Ejecta/**/*.{h,m,mm}",
                "LWFKit/Externals/base64.{h,c}"
            ],
            "requires_arc": false
        },
        {
            "name": "Bindings",
            "source_files": "LWFKit/Bindings/*.{h,m}",
            "requires_arc": false
        }
    ]
}

Pin It on Pinterest

Share This