Giter Site home page Giter Site logo

overlap2d-runtime-libgdx's Introduction

##overlap2d-runtime-libgdx

The overlap2d-runtime-libgdx provides functionality to load, manipulate and render scenes generated by Overlap2D Editor. To be used with libGDX projects. Thanks to roboVM this will work also on iOS.

Overlap2D runtime is based on entity component system (which libGDX supportive incarnation is Ashley)

##Setting Up

If you are using gradle, yo can just add this line to your dependecies:

$ compile "com.underwaterapps.overlap2druntime:overlap2d-runtime-libgdx:0.1.1-SNAPSHOT

Otherwise just download this as sources, and include in your project by any means you see comfortable.

Important Make sure you also have libGDX, and free type fonts library in your dependencies.

When creating new prohect, why not use libGDX setup app? Here are the instructions: http://overlap2d.com/overlap2d-is-just-one-checkbox-away-with-libgdx-official-setup-app/

When generated the project, just make sure to change the version of overlap2d runtime to 0.1.1-SNAPSHOT (this will be updated soon)

##Using Spine with your o2d runtime Spine is not included by default, instead it's kind of an external plugin. Because Spine runtime is not in maven, here is the hell you have to go throguh:

  1. Get spine runtime for it's official github, and make sure it is included in your project.

  2. Add this to your settings.gradle:

    $ include 'spine-o2d-extension' $ project(':spine-o2d-extension').projectDir = new File(settingsDir, 'overlap2d-runtime-libgdx/extensions/spine')

  3. in your build.gradle, add this:

    project(":spine-o2d-extension") {
        apply plugin: "java"
        sourceSets.main.java.srcDirs = ["src/"]

        dependencies {
            compile project(":spine-runtime-libgdx");
            compile project(":overlap2d-runtime-libgdx");
            compile fileTree(dir: 'libs', include: '*.jar')
        }
    }

Also add this to dependencies: $ compile project(":spine-o2d-extension")

Also, after initializing scene loader, add: $ sceneLoader.injectExternalItemType(new SpineItemType());

##Getting started After you are all setup, and assets are exported, here is a sample code to get things rendered

in your create method:

    viewport = new FitViewport(800, 480); // this should be the size of camera in WORLD units. make sure you check that in editor first.
		sl = new SceneLoader(); // default scene loader loads allr esources from default RM as usual.
		sl.loadScene("MainScene", viewport); // loading scene as usual

in your draw method:

    Gdx.gl.glClearColor(0, 0, 0, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		sl.getEngine().update(Gdx.graphics.getDeltaTime()); // getting the ashley engine and updating it (it will render things with it's own render system)

overlap2d-runtime-libgdx's People

Contributors

azakhary avatar erodozer avatar gevorg-kopalyan avatar jtakakura avatar saqsun avatar

Watchers

 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.