Back to project page Flumpgdx.
The source code is released under:
Copyright (c) 2014 Daniyal Khan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softw...
If you think the Android project Flumpgdx listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.flumpgdx; /*from ww w. j av a 2 s . c om*/ import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; import com.badlogic.gdx.math.MathUtils; import com.flumpgdx.display.FlumpAnimation; import com.flumpgdx.library.FlumpLibraryFile; import com.flumpgdx.library.MovieMaker; public class FlumpGDX implements ApplicationListener { private OrthographicCamera camera; private SpriteBatch batch; private ShapeRenderer shape; private FlumpLibraryFile file; private FlumpAnimation animation; float w; float h; long time; @Override public void create() { w = Gdx.graphics.getWidth(); h = Gdx.graphics.getHeight(); camera = new OrthographicCamera(w, h); batch = new SpriteBatch(); shape = new ShapeRenderer(); // file = FlumpLibraryFile.deserialize("tiles"); // animation = MovieMaker.make(file, "GrassPathXX"); file = FlumpLibraryFile.deserialize("Battle_Grass"); animation = MovieMaker.make(file, "UIHPMainFull"); // file = FlumpLibraryFile.deserialize("Battle_Grass"); // animation = MovieMaker.make(file, "OrbEnhancementFull"); // file = FlumpLibraryFile.deserialize("test"); // animation = MovieMaker.make(file, "OrcAttack"); } @Override public void dispose() { batch.dispose(); } @Override public void render() { Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 0.2f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.setProjectionMatrix(camera.combined); //animation.updateSingleFrame(1f); animation.updateToFrame(Gdx.graphics.getDeltaTime(), 50f); batch.begin(); animation.draw(batch); batch.end(); shape.setProjectionMatrix(camera.combined); shape.begin(ShapeType.Line); shape.setColor(Color.WHITE); shape.line(w/2f, 0, -w/2f, 0); shape.line(0, h/2f, 0, -h/2f); shape.end(); } @Override public void resize(int width, int height) { } @Override public void pause() { } @Override public void resume() { } }