标签:: Creator

Spine闪白效果

Spine闪白效果 FlashWhiteSpine.effect 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687

图片闪白效果

图片闪白效果 FlashWhite.effect 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586CCEffect %

一条命令去除 Creator 图片黑边

一条命令去除 Creator 图片黑边https://forum.cocos.org/t/topic/112300 黑边现象是边缘像素与黑色进行插值导致,如果边缘像素和自己相近颜色插值,黑边就会自然消失 基于这个思路将最靠近图片边缘的透明像素的alpha改为3,并且将其RGB值设为邻近非透明像素RGB的插值,简称扩边。 如何安装 工具使用python3编写,需读者自行安装python3环境

Creator动态加载拖尾

Creator动态加载拖尾12345678910cc.resources.load(`xxx`, cc.SpriteFrame, (err, sprite: cc.SpriteFrame) => { if(err) return; let MotionStreak = this.motionStrake.getComponent(cc.MotionStreak) Motio

Creator Tween 动画淡入淡出失效

Creator Tween 动画淡入淡出失效当操作的节点包含 cc.Button 时,tween 操作 opacity 会失效。 解决方案: 1234cc.Tween.stopAllByTarget(item);if(item.getComponent(cc.Button)) item.getComponent(cc.Button).enabled = false;item.opacity =

Creator 构造函数传参

Creator 构造函数传参12345678910111213141516const {ccclass, property} = cc._decorator;@ccclassexport default class Test extends cc.Component { private a:number; private b:number; con

Creator 计算点到直线的距离

Creator 计算点到直线的距离1234567cc.Intersection.pointLineDistance(point, start, end, isSegment)参数列表point Vec2 The pointstart Vec2 The start point of lineend Vec2 The end point of lineisSegment boolean whethe

Creator动态加载粒子

Creator动态加载粒子12345678910cc.resources.load("xxxxx", cc.ParticleAsset, (err, asset) => { if (err || !asset) { cc.log(err) return; } let ps:cc.ParticleSyst

动态加载和释放 cc.Animation

动态加载和释放 cc.Animation加载 1234567891011cc.resources.loadDir("clips/hit", cc.SpriteFrame, (err, sprites: cc.SpriteFrame[]) => { if (err || !sprites) { return; } this.ani

Animation动画的结束回调

Animation动画的结束回调CocosCreator目前支持的Animation回调事件有: 123456789101112131415161718192021222324252627282930313233play : 开始播放时stop : 停止播放时pause : 暂停播放时resume : 恢复播放时lastframe : 假如动画循环次数大于 1,当动画播放到最后一帧时finish

Cocos Creator PKM 图片加密

Cocos Creator PKM 图片加密 python 3.7.0 encodeetc.py 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778

pkm与png的相互转化

pkm与png的相互转化 png2pkm 1etcpack.exe [input.png] [outputdir] -c etc1 -s slow -as -ext PNG pkm2png 1etcpack [input.pkm] [outputdir] -ext PNG

Creator 批量修改 ETC

Creator 批量修改 ETC setETC.js 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667const fs = require('fs');const path

pathfinding 库的使用

pathfinding 库的使用 安装 1npm install pathfinding 使用 12345678910111213141516let pathfinding = require('pathfinding') // use this for initialization onLoad: function () { va

屏蔽敏感字 TS 版

屏蔽敏感字 TS 版关键词屏蔽算法 DFA 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293

全屏覆盖点击效果穿透层实现

全屏覆盖点击效果穿透层实现123456789101112onLoad() { this.coverNode.on(cc.Node.EventType.TOUCH_END, this.onClickTouchEnd, this, true); this.coverNode._touchListener.setSwallowTouches(false);}onDest

动态创建 cc.AnimationClip

动态创建 cc.AnimationClip12345678cc.resources.load(path, (err, clip: cc.AnimationClip) => { if (err) { return; } let anim = node.getComponent(cc.Animation); anim.addC

JS随机数种子

JS随机数种子https://www.cnblogs.com/honeynm/p/5323821.html 若每次使用的种子相同 ,生成的随机数也是相同的,若每一使用不同的种子,则生成的随机数也会不同。 1234567891011121314Math.seed = 5; Math.seededRandom = function(max, min) {   max = max || 1;

统计图片内存占用

统计图片内存占用大概就是遍历cc.loader._cache数组, 把里边的图数据拿出来(cc.Texture2D)内存占用 = width * height * (“png” ? 4 : 3) // png 占4 字节rgba, jpg 占3字节rgb加一下就好了

APP 数据参考

APP 数据参考 模拟经营 – | 次留 | 7留 | 30留 | 30日LT | 120日LT | 人均时长 | 人均广告 | eCPM | ARPU | 测试CPA | 规模CPA | 裂变K值—|—|—|—|—|—|—|—|—|—|—|—|—|—安卓 | 35 | 7 | 0.7 | 2.6 | 3.3 | 30 | 12 | 168 | 2.4 | 8.7 | 10.5 | 0.2苹

虚拟列表(ScrollView)

虚拟列表(ScrollView)https://github.com/gh-kL/cocoscreator-list 在线Demo: https://gh-kl.github.io/cocoscreator-list/web-mobile/index.html 支持: 123456所有类型布局。(单列、单行、网格,甚至各种花式RIGHT_TO_LEFT、BOTTOM_TO_TOP)分帧渲染。选

Chrome调试常用快捷键

Chrome调试常用快捷键123451.在已加载的资源中,打开文件:Ctrl+P(或O) ;2.在已加载的资源中,搜索字符串:Ctrl + Shift + F ;3.跳转到指定行:Ctrl + G(大部分文本编辑器也适用);4.在某个js中快速查找方法:Ctrl + Shift + O ;5.在某个文件中查找下一个匹配项:Ctrl + D ;

使用 pngquant 缩图

使用 pngquant 缩图https://www.jianshu.com/p/a721fbaa62ab 下载PNGCompressForMac工具: https://gitee.com/mirrors_ashqal/PNGCompressForMac 使用方法如下: 123sudo su -sudo spctl --master-disablesh PNGCompress PATH/TO/YO

颜色可变的剪影效果 Shader

颜色可变的剪影效果 Shaderhttps://cloud.tencent.com/developer/article/1659055 eazax-silhouette.effect 文件 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152// Copy