Gloader url引用动画播放完怎样释放包内存不释放

ccjss136 回复了问题 • 3 人关注 • 5 个回复 • 341 次浏览 • 2023-11-17 16:57 • 来自相关话题

图形遮罩支持圆角

bydreamxxx 发表了文章 • 1 个评论 • 261 次浏览 • 2023-10-26 16:13 • 来自相关话题

本来想用github发pull request的,一直clone失败
GComponent.prototype._updateGraphics = function() {
// @ts-ignore.
let graphics = this._graphics;
if (!graphics) {
return;
}
this.onDraw(graphics);
}

/**
* mask 用于绘制罩子的函数.
* this 指向mask 对象,需要特别注意.
* @param graphics
*/
GComponent.prototype.onDraw = function(graphics) {
// Share render data with graphics content
graphics.clear(false);
let node = this.node;
let width = node.width;
let height = node.height;
let x = -width * node.anchorX;
let y = -height * node.anchorY;
graphics.roundRect(x, y, width, height, this.radius || 0);
if (cc.game.renderType === cc.game.RENDER_TYPE_CANVAS) {
graphics.stroke();
} else {
graphics.fill();
}
}

GComponent.prototype.onMaskReady = function () {
this.off(fgui.Event.DISPLAY, this.onMaskReady, this);
if (this._maskContent instanceof fgui.GImage) {
this._customMask.type = cc.Mask.Type.IMAGE_STENCIL;
this._customMask.alphaThreshold = 0.0001;
this._customMask.spriteFrame = this._maskContent._content.spriteFrame;
}
else if (this._maskContent instanceof fgui.GGraph) {
if (this._maskContent.type == 2)
this._customMask.type = cc.Mask.Type.ELLIPSE;
else {
this._customMask.type = cc.Mask.Type.RECT;
let r = this._maskContent._cornerRadius[0];
let _radius = r >= 0 ? r : 0;
if (_radius < 1) {
_radius = Math.min(this.node.width, this.node.height) * _radius;
}
this._customMask["radius"] = _radius;
this._customMask["onDraw"] = this.onDraw.bind(this._customMask);
this._customMask["_updateGraphics"] = this._updateGraphics.bind(this._customMask);
this._customMask.type = cc.Mask.Type.RECT;
}
}
};主要修改GComponent.prototype.onMaskReady 查看全部
本来想用github发pull request的,一直clone失败
GComponent.prototype._updateGraphics = function() {
// @ts-ignore.
let graphics = this._graphics;
if (!graphics) {
return;
}
this.onDraw(graphics);
}

/**
* mask 用于绘制罩子的函数.
* this 指向mask 对象,需要特别注意.
* @param graphics
*/
GComponent.prototype.onDraw = function(graphics) {
// Share render data with graphics content
graphics.clear(false);
let node = this.node;
let width = node.width;
let height = node.height;
let x = -width * node.anchorX;
let y = -height * node.anchorY;
graphics.roundRect(x, y, width, height, this.radius || 0);
if (cc.game.renderType === cc.game.RENDER_TYPE_CANVAS) {
graphics.stroke();
} else {
graphics.fill();
}
}

GComponent.prototype.onMaskReady = function () {
this.off(fgui.Event.DISPLAY, this.onMaskReady, this);
if (this._maskContent instanceof fgui.GImage) {
this._customMask.type = cc.Mask.Type.IMAGE_STENCIL;
this._customMask.alphaThreshold = 0.0001;
this._customMask.spriteFrame = this._maskContent._content.spriteFrame;
}
else if (this._maskContent instanceof fgui.GGraph) {
if (this._maskContent.type == 2)
this._customMask.type = cc.Mask.Type.ELLIPSE;
else {
this._customMask.type = cc.Mask.Type.RECT;
let r = this._maskContent._cornerRadius[0];
let _radius = r >= 0 ? r : 0;
if (_radius < 1) {
_radius = Math.min(this.node.width, this.node.height) * _radius;
}
this._customMask["radius"] = _radius;
this._customMask["onDraw"] = this.onDraw.bind(this._customMask);
this._customMask["_updateGraphics"] = this._updateGraphics.bind(this._customMask);
this._customMask.type = cc.Mask.Type.RECT;
}
}
};
主要修改GComponent.prototype.onMaskReady

cocosCreator 3.x 的生成代码是不是不能用呀?

谷主 回复了问题 • 2 人关注 • 1 个回复 • 277 次浏览 • 2023-10-13 08:55 • 来自相关话题

[Scene] 'RenderComponent' is removed since v1.2.0, please use 'UIRenderer' instead.

谷主 回复了问题 • 2 人关注 • 1 个回复 • 441 次浏览 • 2023-09-11 18:39 • 来自相关话题

图片平铺九宫格,编辑器里面正常,creator web,手机端预览没有平铺效果

谷主 回复了问题 • 2 人关注 • 1 个回复 • 293 次浏览 • 2023-09-07 11:13 • 来自相关话题

列表没有自动排列是为什么呀,大佬们

谷主 回复了问题 • 2 人关注 • 1 个回复 • 262 次浏览 • 2023-09-07 11:01 • 来自相关话题

ScrollPane中setPercX能控制滚动的时长吗?没有找到相关api啊

谷主 回复了问题 • 3 人关注 • 1 个回复 • 214 次浏览 • 2023-07-27 21:55 • 来自相关话题

按钮选择点击测试按钮图片后,发布项目报错

回复

wodeguaiguai 发起了问题 • 1 人关注 • 0 个回复 • 259 次浏览 • 2023-07-27 11:16 • 来自相关话题

列表的渲染和高级组的居中会有位移

谷主 回复了问题 • 2 人关注 • 2 个回复 • 257 次浏览 • 2023-07-27 10:16 • 来自相关话题

关于 localToGlobal 的问题

回复

chenzm 回复了问题 • 1 人关注 • 4 个回复 • 424 次浏览 • 2023-07-24 17:34 • 来自相关话题

麻烦问一下在list中改变了item的位置(直接改item.x),但在list点击判定时还是原来位置,怎么让他点击绑定到改变后的位置?

Good_Guy 回复了问题 • 2 人关注 • 2 个回复 • 254 次浏览 • 2023-07-18 10:13 • 来自相关话题

cc3.7.3 富文本不会自动换行

谷主 回复了问题 • 2 人关注 • 3 个回复 • 371 次浏览 • 2023-07-14 12:22 • 来自相关话题

图片能设置点击不穿透吗

谷主 回复了问题 • 2 人关注 • 1 个回复 • 423 次浏览 • 2023-07-06 21:57 • 来自相关话题

点击事件被同层级下层节点吞噬掉

谷主 回复了问题 • 2 人关注 • 1 个回复 • 285 次浏览 • 2023-06-29 21:13 • 来自相关话题

list 中的item 点击动效不触发

谷主 回复了问题 • 2 人关注 • 1 个回复 • 287 次浏览 • 2023-06-28 11:55 • 来自相关话题

baseUserData 在代码里面咋set?

谷主 回复了问题 • 1 人关注 • 1 个回复 • 167 次浏览 • 2023-06-16 14:25 • 来自相关话题

creator label

marvin436 回复了问题 • 3 人关注 • 3 个回复 • 1111 次浏览 • 2023-06-08 21:01 • 来自相关话题

FairyGUI: old package format found in, web正常,发布字节小游戏报这个错误

谷主 回复了问题 • 2 人关注 • 1 个回复 • 399 次浏览 • 2023-06-05 20:15 • 来自相关话题

Cocos Creator 鼠标事件中Event.button 值一直返回0,无法取分左右键。

xiaoxiaofan 回复了问题 • 2 人关注 • 2 个回复 • 311 次浏览 • 2023-05-25 11:02 • 来自相关话题

装载器图片拼接有出现黑缝,不用装载器没有问题

谷主 回复了问题 • 2 人关注 • 1 个回复 • 404 次浏览 • 2023-05-24 09:43 • 来自相关话题