zoukankan      html  css  js  c++  java
  • cocos2d相关

     游戏引擎出现的原因:游戏软件功能复杂且性能要求高;游戏软件的运行模式一致

    vs的一些概念:

    解决方案,一个解决方案包含一或多个项目,具体信息可以看vs帮助页上的介绍(里面的插图很形象),链接:https://msdn.microsoft.com/zh-cn/library/b142f8e7.aspx

    在解决方案属性页可以查看和设置项目依赖关系、启动项目

    附加依赖项,项目中所使用的源文件的路径,新建的cocos项目的默认路径是Classes目录,而在vs IDE中新建项时的默认路径是项目根目录

    vs里没有cocos2dx的模板,需要从命令行用 cocos new命令创建项目。假设项目名是HelloCocos,用vs打开后HelloCocos项目的以依赖项是libbox2d、libcocos2d、libspine,用vs首次编译的时候时间会长一些。这几个项目是什么现在还不清楚,libbox2d好像是物理引擎,libcocos2d是基础东西、libspine是骨骼相关的内容。附上cocos2dx目录结构:http://www.cocos.com/docs/native/v2/getting-started/architecture-and-directory-structure/zh.html

     新建的cocos2dx项目目录:

    Classes:C++代码,实现游戏主题

    proj.win32:vs项目文件和Windows端游戏启动代码

    proj.ios:Xcode项目文件和iOS端游戏启动代码

    proj.android:Android项目文件和Android端启动代码

    Resources:美工和音效

    命名空间:这里只知道一点

    源文件 命名空间   常用的类
    cocos2d.h cocos2d 包含常见节点 Layer,Scene,Sprite
    CocosGUI.h cocos2d::ui   Widget
    UIWidget.h cocos2d::Widget   TouchEventType
    cocostudioCocoStudio.h cocostudio 使用cocos studio编辑器需要用到 GUIReader

    cocos常用文件:

    cocos2d.h 包含下面几方面的内容

    //
    // all cocos2d include files
    //
    #include "base/ccConfig.h"
    
    
    // base
    #include "base/CCAsyncTaskPool.h"
    #include "base/CCAutoreleasePool.h"
    ......
    
    // EventDispatcher
    #include "base/CCEventAcceleration.h"
    ......
    // math
    #include "math/CCAffineTransform.h"
    // actions
    #include "2d/CCAction.h"
    
    // 2d nodes
    #include "2d/CCAtlasNode.h"
    
    // 2d utils
    // include
    #include "base/CCProtocols.h"
    
    // renderer
    // physics
    
    // platform

    uiCocosGUI.h

    在声明函数的时候有一个参数是cocos2d::ui::Widget::TouchEventType,不导入这个源文件编译报错:“error C2027: 使用了未定义类型”

  • 相关阅读:
    kibana x-pack 更新license
    elastic search集群请求超时
    angular4 angular/cli 版本升级
    windows 编写shell 脚本转化成unix
    spring boot 自定义HandlerMethodArgumentResolver做参数校验
    Fiddler 重定向BUG
    scoop
    acm每日刷题记录
    ccpc 2016 changchun 长春(4.12训练)
    cf 338E
  • 原文地址:https://www.cnblogs.com/afraidToForget/p/6934973.html
Copyright © 2011-2022 走看看