通知设置 新通知
fgui 富文本在cocos creator上自动收缩不管用?
谷主 回复了问题 • 2 人关注 • 1 个回复 • 57 次浏览 • 5 天前
当有fgui 的groot存在,cocos creator的node就无法点击
freelancer13 回复了问题 • 3 人关注 • 4 个回复 • 119 次浏览 • 2023-11-22 17:03
Cocos Creator 3.5 调用 fgui.GRoot.create(); 之后,Creator的 input 事件监听不到。
pandajc 回复了问题 • 2 人关注 • 1 个回复 • 1145 次浏览 • 2023-11-21 15:59
输入框在creator3.8上位置显示不正确
sujing263 回复了问题 • 2 人关注 • 1 个回复 • 39 次浏览 • 2023-11-20 16:21
如何获取图片被组件引用的数量?
谷主 回复了问题 • 2 人关注 • 1 个回复 • 75 次浏览 • 2023-11-20 10:07
Gloader url引用动画播放完怎样释放包内存不释放
ccjss136 回复了问题 • 3 人关注 • 5 个回复 • 132 次浏览 • 2023-11-17 16:57
图形遮罩支持圆角
bydreamxxx 发表了文章 • 1 个评论 • 91 次浏览 • 2023-10-26 16:13
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 查看全部
GComponent.prototype._updateGraphics = function() {主要修改GComponent.prototype.onMaskReady
// @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;
}
}
};
cocosCreator 3.x 的生成代码是不是不能用呀?
谷主 回复了问题 • 2 人关注 • 1 个回复 • 153 次浏览 • 2023-10-13 08:55
[Scene] 'RenderComponent' is removed since v1.2.0, please use 'UIRenderer' instead.
谷主 回复了问题 • 2 人关注 • 1 个回复 • 234 次浏览 • 2023-09-11 18:39
图片平铺九宫格,编辑器里面正常,creator web,手机端预览没有平铺效果
谷主 回复了问题 • 2 人关注 • 1 个回复 • 152 次浏览 • 2023-09-07 11:13
列表没有自动排列是为什么呀,大佬们
谷主 回复了问题 • 2 人关注 • 1 个回复 • 164 次浏览 • 2023-09-07 11:01
ScrollPane中setPercX能控制滚动的时长吗?没有找到相关api啊
谷主 回复了问题 • 2 人关注 • 1 个回复 • 128 次浏览 • 2023-07-27 21:55
列表的渲染和高级组的居中会有位移
谷主 回复了问题 • 2 人关注 • 2 个回复 • 153 次浏览 • 2023-07-27 10:16
麻烦问一下在list中改变了item的位置(直接改item.x),但在list点击判定时还是原来位置,怎么让他点击绑定到改变后的位置?
Good_Guy 回复了问题 • 2 人关注 • 2 个回复 • 147 次浏览 • 2023-07-18 10:13
cc3.7.3 富文本不会自动换行
谷主 回复了问题 • 2 人关注 • 3 个回复 • 248 次浏览 • 2023-07-14 12:22
图片能设置点击不穿透吗
谷主 回复了问题 • 2 人关注 • 1 个回复 • 246 次浏览 • 2023-07-06 21:57
点击事件被同层级下层节点吞噬掉
谷主 回复了问题 • 2 人关注 • 1 个回复 • 163 次浏览 • 2023-06-29 21:13
list 中的item 点击动效不触发
谷主 回复了问题 • 2 人关注 • 1 个回复 • 158 次浏览 • 2023-06-28 11:55