Cocos Creator常用API

1.循环播放动画

// 物体放缩
var toBig = cc.scaleTo(0.8, 0.9);
var toSmall = cc.scaleTo(0.8, 0.7);
this.exGoldButton.runAction(cc.repeatForever(cc.sequence(toBig, toSmall)));
//箭头平移
let stPos = new cc.Vec2(-100, 80);
let edPos = new cc.Vec2(-20, -30)
let time = 0.8;
this.YinDaoShouZhi.setPosition(stPos);
let action = cc.moveTo(time, edPos);
let repeat = cc.sequence(action, cc.place(stPos))
this.YinDaoShouZhi.stopAllActions();
this.YinDaoShouZhi.runAction(cc.repeatForever(repeat));

2.播放问号动画 

    let toBig = cc.scaleTo(0.25, 1.05);
        let toSmall = cc.scaleTo(0.25, 0.8);
        let toNormal = cc.scaleTo(0.2, 1);
        let toBig1 = cc.scaleTo(0.25, 1.05);
        let toSmall1 = cc.scaleTo(0.25, 0.8);
        let toNormal1 = cc.scaleTo(0.2, 1);
        this.helpBtn.runAction(cc.sequence(toBig, toSmall, toNormal, toBig1, toSmall1, toNormal1, cc.callFunc(() => {
            this.errCount++;
        })));

3.项目相关: 

// 分享审核

const WXFeedBack = require('WXFeedBack');
const WXGameClub = require('WXGameClub');


WXFeedBack.showFeedBackButton();
WXGameClub.showGameClubButton();

WXGameClub.hideGameClubButton();
WXFeedBack.hideFeedBackButton();
const Share = require("Share")  

Share.initMsg();

share() {
        let obj = {
            title: "能闯过100关,你的成语储备已经超过80%!",
            imageUrl: "http://weixin.gzfingertip.cn/wegame/sharepic/cyqwp0628.jpg",
            regularTime: 0,
            isAds: false,
        }
        Share.shareGameMsg(obj);
}

 Comm_Platform

Comm_Platform.creatBanner(false, this.bannerNode, 'CYBC', 'banner1');
Comm_Platform.hideBanner();

播发视频: 

    Comm_Platform.showVideoAds({
            sucessVedio: () => {},
            failVedio: () => { },
            successShare: () => { },
            failShare: () => { }
        })

初始化: 

 Comm_Platform.init('CYBC', 'CYBC_STAT');
import Comm_Log from "./Comm_Log";
import Comm_Main from "../Comm_Main";

const CCGlobal = require('CCGlobal');
const CCConst = require('CCConst');
const Stat = require("Statistics");
const Ads = require('AdsFunc');
const Share = require('Share');
const QQRank = require("QQrank");

interface VideoCallBack {
    pos?: string,
    successShare: Function,
    sucessVedio: Function,
    failShare: Function,
    failVedio: Function,
};

/**
 * 通用平台组件
 */
class Comm_Platform {
    private constructor() { };
    private static instance: Comm_Platform = null;
    public static getInstance(): Comm_Platform {
        this.instance = this.instance || new Comm_Platform();
        return this.instance;
    };
    private AudioPlayer = null;
    private _gameKey: string = '';                  // 玩法key值
    private _statName: string = '';                 // 统计时使用的游戏名
    private _api: any = null;                       // sdk
    private _isInit: boolean = false;               // 初始化
    private _networkState: boolean = false;          // 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值