zoukankan      html  css  js  c++  java
  • 怎样加入cocostudio生成的UI到项目

    cocos2dx版本号:cocos2d-x-3.2alpha0

    cocostudio版本号:V1.4.0.1


    1.将cocostudio生成的UI文件复制到项目Resources目录


    2.加入头文件,加入命名空间

    #include "cocos-ext.h"
    #include "editor-support/cocostudio/CCSGUIReader.h"
    #include "ui/CocosGUI.h"

    using namespace ui;


    3.加入现有项目到解决方式

    cocos2dextensions
    cocos2dcocoseditor-supportcocostudio
    cocos2dcocosui


    4.设置项目属性,加入包括文件夹

    cocos2d
    cocos2dcocoseditor-support
    cocos2dcocoseditor-supportcocostudio


    5.设置项目属性,加入引用项


    6.加入UI代码

    auto _uiLayer = Layer::create();
    addChild(_uiLayer);
    auto _widget = dynamic_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("DemoHead_UI.ExportJson"));
    _uiLayer->addChild(_widget);





    
    
    
  • 相关阅读:
    Oracle 单引号与双引号的区别
    oracle 生成随机数
    oracle 表空间及查看所有用户的表空间
    字节和字符的区别
    java io
    Oracle 基础
    gvim 常用键
    Python之struct
    Python之MySQLdb
    Python之sqlite3
  • 原文地址:https://www.cnblogs.com/lcchuguo/p/5373562.html
Copyright © 2011-2022 走看看