Coder Social home page Coder Social logo

ashishpatelmi / flare-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 2d-inc/flare-swift

0.0 0.0 0.0 1.06 MB

Swift runtime for Flare.

Home Page: https://www.2dimensions.com/about-flare

License: MIT License

Swift 99.38% Objective-C 0.22% C++ 0.10% Shell 0.31%

flare-swift's Introduction

Flare

Flare is a powerful design and animation tool for app and game designers alike. The primary goal of Flare is to allow designers to work directly with assets that run in their final product, eliminating the need to redo that work in code.

Flare-Swift

Swift runtime for Flare: export files from Flare and run them on iOS!

Only Binary format is supported right now, but JSON support is in the works.

Problems

If you encounter any problems report them in the issue tracker and, if applicable, include your Flare file.

Contents

The repository contains an XCode Project structured as follows:

  • FlareSwift - Swift Framework for loading and drawing Flare files
    • FlareCore is the bottommost layer of the Framework: this is where Flare file contents are read, loaded and built in-memory
    • FlareSkia handles the drawing operations in an OpenGL context. It relies on libskia, which is built with a custom script (see Usage)

This project contains multiple targets:

  • FlareSwift - builds the Framework that runs on physical devices.
  • FlareSwiftDev - builds the Framework that runs on Simulators.
  • Example - A simple example demonstrating how to add a FlareSkViewController in a Single View App ViewController. It draws inside the FlareSkView associated with the FlareSkViewController.
  • ExampleController - Demonstrates how to create a CustomController that is an extension of FlareSkViewController. This class takes advantage of the available APIs by overriding advanceControls(), using a custom callback for swapping animations on completed (i.e. onCompleted()), and adding a play() function that plays a new animation allowing the user to specify the interpolation mix and time.

Using the Framework

  • Clone the repository:
git clone [email protected]:2d-inc/Flare-Swift.git
  • Open FlareSwift.xcodeproj
  • In the XCode window, select the scheme for the device you want to run on:
    • Use FlareSwift to build the Framework for a physical device
    • Use FlareSwiftDev to build the Framework for a Simulator

N.B: first time building the Framework takes a while, as it is initializing and building all the dependencies. Use the Report Navigator to have an overview of what's happening.

  • Build the Framework (โŒ˜ + B)

The Framework can be found in the Products folder.
Access the Products folder from XCode by right clicking on it > Show in Finder.

In Your Project:

  • Drag-and-drop the .framework file into the XCode window.
    • In the import dialog, select "Copy items if needed" and the target in "Add to Targets"
  • Add the Framework to the Build Phases:
    • Select the Project in the Project Navigator
    • Select your Target
    • Build Phases
    • Add the Framework to the Embed Frameworks phase.

Running the Examples

The examples are configured to be run on a Simulator.

If you want to run them on a physical device, follow these steps:

  • Select the example project in the Project Navigator
  • Select the project target from the target list
  • Under the Framework, Libraries and Embedded Content menu:
    • Select FlareSwiftDev.framework and press the minus (-) button to remove it
    • Use the plus (+) button to add FlareSwift.framework
  • Run the example N.B. if the Framework needs to run a clean build for the device, this process might take a while. Use the Report Navigator to look at what's happening.

License

See the LICENSE file for license rights and limitations (MIT).

The Bezier folder is a port of bezier.dart, and is complying with their LICENSE.txt (BSD 2-Clause License).

flare-swift's People

Contributors

artur-ios-dev avatar umberto-sonnino avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.