图片闪白效果
图片闪白效果FlashWhite.effect12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485CCEffect %{
图片闪白效果FlashWhite.effect12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485CCEffect %{
一条命令去除 Creator 图片黑边相关讨论链接 黑边现象是边缘像素与黑色进行插值导致,如果边缘像素和自己相近颜色插值,黑边就会自然消失 基于这个思路将最靠近图片边缘的透明像素的alpha改为3,并且将其RGB值设为邻近非透明像素RGB的插值,简称扩边。 如何安装工具使用python3编写,需读者自行安装python3环境 方法1(推荐): 通过pip下载安装1pip install png-d
Creator动态加载拖尾12345678910cc.resources.load(`xxx`, cc.SpriteFrame, (err, sprite: cc.SpriteFrame) => { if(err) return; let MotionStreak = this.motionStrake.getComponent(cc.MotionStreak) Motion
Creator Tween 动画淡入淡出失效当操作的节点包含 cc.Button 时,tween 操作 opacity 会失效。 解决方案1234cc.Tween.stopAllByTarget(item);if(item.getComponent(cc.Button)) item.getComponent(cc.Button).enabled = false;item.opacity = 0;c
Creator 构造函数传参123456789101112131415const {ccclass, property} = cc._decorator;@ccclassexport default class Test extends cc.Component { private a:number; private b:number; constr
Creator 计算点到直线的距离1cc.Intersection.pointLineDistance(point, start, end, isSegment) 参数列表 point Vec2 The point start Vec2 The start point of line end Vec2 The end point of line isSegment boolean whether
Creator动态加载粒子12345678910cc.resources.load("xxxxx", cc.ParticleAsset, (err, asset) => { if (err || !asset) { cc.log(err) return; } let ps:cc.ParticleSyste
动态加载和释放 cc.Animation加载1234567891011cc.resources.loadDir("clips/hit", cc.SpriteFrame, (err, sprites: cc.SpriteFrame[]) => { if (err || !sprites) { return; } this.anim.
Animation动画的结束回调CocosCreator目前支持的Animation回调事件有: 1234567891011121314151617181920212223242526272829303132play : 开始播放时stop : 停止播放时pause : 暂停播放时resume : 恢复播放时lastframe : 假如动画循环次数大于 1,当动画播放到最后一帧时finished
Cocos Creator lzutf8 高性能 Javascript 字符串压缩库对速度进行了强烈优化 似测量:3-14MB / s压缩,20-120MB / s解压缩
Cocos Creator PKM 图片加密 python 3.7.0 encodeetc.py 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
pkm与png的相互转化png2pkm1etcpack.exe [input.png] [outputdir] -c etc1 -s slow -as -ext PNG pkm2png1etcpack [input.pkm] [outputdir] -ext PNG
Creator 批量修改 ETCsetETC.js12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667const fs = require('fs');const path = re
Creator 适配组件 SafeArea 频繁切出切入 APP 导致适配问题把所有 Widget 组件的 Align Mode 改成 Once,==必须是所有 Widget 组件==
修改 Creator 创建的 TS 文件模板修改这个文件 C:\CocosDashboard_1.0.6\resources.editors\Creator\2.4.6\resources\static\template\new-script.ts
pathfinding 库的使用安装1npm install pathfinding 使用12345678910111213141516let pathfinding = require('pathfinding') // use this for initialization onLoad: function () { var matri
屏蔽敏感字 TS 版关键词屏蔽算法 DFA 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192pri
全屏覆盖点击效果穿透层实现123456789101112onLoad() { this.coverNode.on(cc.Node.EventType.TOUCH_END, this.onClickTouchEnd, this, true); this.coverNode._touchListener.setSwallowTouches(false);}onDestr
动态创建 cc.AnimationClip12345678cc.resources.load(path, (err, clip: cc.AnimationClip) => { if (err) { return; } let anim = node.getComponent(cc.Animation); anim.addCl
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加一下就好了
Cocos Creator热更新 - 小白教程https://www.jianshu.com/p/cec263b6b9ac
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 苹果 42 9.5 1.2 3.2 4.3 40 18 290 5 27 41 0.5
虚拟列表(ScrollView)https://github.com/gh-kL/cocoscreator-list 在线Demohttps://gh-kl.github.io/cocoscreator-list/web-mobile/index.html 支持123456所有类型布局。(单列、单行、网格,甚至各种花式RIGHT_TO_LEFT、BOTTOM_TO_TOP)分帧渲染。选择模式。(
Chrome调试常用快捷键123451.在已加载的资源中,打开文件:Ctrl+P(或O) ;2.在已加载的资源中,搜索字符串:Ctrl + Shift + F ;3.跳转到指定行:Ctrl + G(大部分文本编辑器也适用);4.在某个js中快速查找方法:Ctrl + Shift + O ;5.在某个文件中查找下一个匹配项:Ctrl + D ;
ARM架构的M1芯片新的MAC在使用Cocos上会有不兼容的问题Creator 打开会黑屏 解决方案Cocos Creator 升级到 2.4.5 以上即可
Creator 热更千万不要随便修改脚本加密密钥,否则会热更失败
使用 pngquant 缩图https://www.jianshu.com/p/a721fbaa62ab 下载PNGCompressForMac工具https://gitee.com/mirrors_ashqal/PNGCompressForMac 使用方法如下123sudo su -sudo spctl --master-disablesh PNGCompress PATH/TO/YOUR/RE
颜色可变的剪影效果 Shaderhttps://cloud.tencent.com/developer/article/1659055 eazax-silhouette.effect 文件123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051// Copyright
TinyCocosFix – Cocos热更新的非官方解决方案https://oedx.github.io/2021/02/22/TinyCocosFix/ TinyCocosFix 是基于 native 端实现,因此能够在 Cocos 引擎未启动时就开始热更新流程;我们将文件 diff 的逻辑放在服务端,服务端直接将两个版本的 diff 文件压缩成 zip 包返回给客户端,然后客户端再针对 zi