Giter Club home page Giter Club logo

cocos-ui-libgdx's Introduction

Build Status Codacy Badge Coverage Status Maintenance Apache 2

存档状态

虽然Cocos Studio已经处于实质上被官方放弃的状态,但是本项目依然不定期维护。 注意:必须把cocostudio的"编辑"选择 "拖动改变尺寸"

cocos-ui-libgdx

展示

图片来自网络,学习之用,如有侵权,请通知删除

特性

  • 支持最新版的Cocos Studio进行开发,版本号v3.10
  • 仅支持Cocos Studio的Json格式,请在发布项目时选择Json格式
  • 支持Cocos Studio中大部分控件
  • 部分支持Cocos Studio的粒子效果
  • 部分支持Cocos Studio的动画效果,包括位移动画,缩放动画,帧动画(倾斜动画不支持)

快速入门

build.gradle中添加

    repositories {
       mavenCentral()
       maven { url 'https://jitpack.io' }
    }

    dependencies {
       compile 'com.github.varFamily:cocos-ui-libgdx:0.1.4'
       compile 'com.github.tianqiujie:nativefont:2.5.0'
    }

在代码中

FileHandle defaultFont = defaultFont = Gdx.files.internal("share/MLFZS.TTF");;
CocoStudioUIEditor editor = new CocoStudioUIEditor(
    Gdx.files.internal("demo/MainScene.json"), null, null, defaultFont, null);
Group group = editor.createGroup();

使用AssetManager

//load
 assetManager = new AssetManager();
        assetManager.setLogger(new Logger("hehehe", Logger.DEBUG));
        assetManager.setLoader(CocosScene.class, new CocosLoader(new InternalFileHandleResolver()));
        assetManager.load("mainscene/MenuScene.json", CocosScene.class);
//render
if (!init) {
            if (assetManager.update()) {
                init = true;
                initUi();
            }
        }
//initUi
CocosScene cocosScene = assetManager.get("mainscene/MenuScene.json", CocosScene.class);
        root = cocosScene.getRoot();
        stage.addActor(cocosScene.getRoot(assetManager));
        Gdx.input.setInputProcessor(stage);

###详细demo请看AMScreen

源码构建

项目使用gradle管理,直接运行./gradlew build即可。

如果需要运行demo,执行./gradlew demo即可。

##有问题反馈 在使用中有任何问题,欢迎用以下方式进行反馈

  • 在Github中直接创建一个issue
  • QQ群:187378034
  • QQ: 634416025

下一步计划

  • 完善cocos2dx的粒子系统
  • 添加更多单元测试
  • 检测所有Cocos Studio的demo,确保没有遗漏

感谢

  • 群友@Hey贡献了粒子解析效果的代码

cocos-ui-libgdx's People

Contributors

htynkn avatar badboy-tian avatar

Watchers

AsTupidX 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.