zoukankan      html  css  js  c++  java
  • Cocos2dx制作帧动画

    1.使用plist + png方式加载资源图,参数只需要plist路径

    cc.SpriteFrameCache:getInstance()::addSpriteFrames("res/yk/china/loading.plist")

    2.使用plist + prv.ccz方式加载资源图,参数需要plist路径和ccz的路径

    cc.SpriteFrameCache:getInstance()::addSpriteFrames("res/yk/china/loading.plist", "res/yk/china/loading.pvr.ccz");

    代码举例:

    cc.SpriteFrameCache:getInstance()::addSpriteFrames("res/yk/china/loading.plist")
    --cc.SpriteFrameCache:getInstance()::addSpriteFrames("res/yk/china/loading.plist", "res/yk/china/loading.pvr.ccz");
    local Layer = cc.CSLoader:createNode("res/loading.csb")  --cocoStudio做的UI工程
    local Action = cc.CSLoader:createTimeline("res/loading.csb") --序列帧动画
    Layer:runAction(Action)
    --Action:setTimeSpeed(10/60)
    Action:gotoFrameAndPlay(0, true)
    xxx:addChild(Layer, 1)

  • 相关阅读:
    MyBatis简介
    JDBC报错:Cannot find class: com.mysql.jdbc.Driver
    进程,线程,协程
    mamp提示 more elements...
    获取html页面的参数
    php基础函数
    返回接口
    生成订单号
    xml转数组
    判断是否是微信浏览器
  • 原文地址:https://www.cnblogs.com/mingfuqishi/p/7792241.html
Copyright © 2011-2022 走看看