通知设置 新通知
unity动效适配
Unity • salamander 回复了问题 • 2 人关注 • 2 个回复 • 70 次浏览 • 2023-11-15 09:38
Unity2022.3版本下TextMeshPro描边问题
Unity • 谷主 回复了问题 • 2 人关注 • 1 个回复 • 88 次浏览 • 2023-11-14 11:07
fgui 小按钮在大按钮上面 点击小按钮 大按钮也会响应点击
Unity • ankisme 回复了问题 • 2 人关注 • 4 个回复 • 1374 次浏览 • 2023-11-09 11:19
求助,在Unity中通过UIConfig设置全局按键声音无效
Unity • 谷主 回复了问题 • 2 人关注 • 1 个回复 • 75 次浏览 • 2023-11-09 08:56
texturepacker导出的plist 导入FGUI后会出现问题
编辑器使用 • 谷主 回复了问题 • 2 人关注 • 1 个回复 • 70 次浏览 • 2023-11-07 10:39
Laya 本地运行官方的 Guidedemo的例子中点击StartGuide按钮出现遮罩后包囊按钮不能点击,但从官方提供在线的laya实例是可以点击。
Laya • 谷主 回复了问题 • 2 人关注 • 4 个回复 • 111 次浏览 • 2023-11-06 17:49
假设按钮有默认动效,我在初始化界面的时候需要设置现在的按钮的状态,如果直接设置selectd,或者index会触发动画效果,应该怎么做不触发效果
编辑器使用 • 谷主 回复了问题 • 2 人关注 • 1 个回复 • 62 次浏览 • 2023-11-06 17:48
要如何判断一个ui是否在其他ui之上
Unity • sd1840888 回复了问题 • 2 人关注 • 1 个回复 • 84 次浏览 • 2023-11-03 18:47
能否将当前打开的项目名字显示在编辑器顶栏?
编辑器使用 • 神逸疏狂 发表了文章 • 1 个评论 • 57 次浏览 • 2023-11-03 18:20
Unity平台,文本换行保护(解决标点符号处于行首行末、数字因换行而分离的问题)
Unity • kL 发表了文章 • 1 个评论 • 140 次浏览 • 2023-11-01 16:04
或者括号刚好处于换行处,将会变成这样:
又或者一串较长的数字刚好处于换行处,将会变成这样:
... ...
但我不想这样,为啥?因为这样游戏无法过审!
后来逛了下论坛,也没找到合适的解决方案,就决定自己倒腾了。
下面是我的成果~
▲ 上图展示了标点符号换行效果。其实图内还有一个效果就是当“他”字也被挪到第二行时,第一行的字就变少了,所以就将第一行的字距变宽了,这样就达到了与 Office Word 差不多的效果(该效果默认是禁用的,可通过 TextFormat 的 CWP_StretchEnabled 来启用/禁用)
▲ 上图展示了英文单词换行效果。
▲ 上图展示了长数字换行效果。
... ...
代码改造都有尽量绕开谷主的源码,功能也都做了开关(都在 TextFormat 里,以 CWP 开头的变量)。主要进行代码改造的地方是 TextField.cs 。
基于v4.3.0的源码改造的(谷主很久都没更新了呢)。
具体代码在附件,可以直接覆盖使用。 查看全部
或者括号刚好处于换行处,将会变成这样:
又或者一串较长的数字刚好处于换行处,将会变成这样:
... ...
但我不想这样,为啥?因为这样游戏无法过审!
后来逛了下论坛,也没找到合适的解决方案,就决定自己倒腾了。
下面是我的成果~
▲ 上图展示了标点符号换行效果。其实图内还有一个效果就是当“他”字也被挪到第二行时,第一行的字就变少了,所以就将第一行的字距变宽了,这样就达到了与 Office Word 差不多的效果(该效果默认是禁用的,可通过 TextFormat 的 CWP_StretchEnabled 来启用/禁用)
▲ 上图展示了英文单词换行效果。
▲ 上图展示了长数字换行效果。
... ...
代码改造都有尽量绕开谷主的源码,功能也都做了开关(都在 TextFormat 里,以 CWP 开头的变量)。主要进行代码改造的地方是 TextField.cs 。
基于v4.3.0的源码改造的(谷主很久都没更新了呢)。
具体代码在附件,可以直接覆盖使用。
关于一个节点下有多个gowrapper的使用
Unity • 谷主 回复了问题 • 2 人关注 • 1 个回复 • 101 次浏览 • 2023-11-01 10:11
Unity怎么检测鼠标下有FairyGUI元件
Unity • zaq17410 回复了问题 • 3 人关注 • 2 个回复 • 1412 次浏览 • 2023-10-29 22:52
FGUI中如何制作鼠标悬停显示内容
编辑器使用 • zaq17410 回复了问题 • 3 人关注 • 2 个回复 • 942 次浏览 • 2023-10-29 22:18
图形遮罩支持圆角
CocosCreator • 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;
}
}
};
滚动容器计算高度时未排除隐藏的元件!
编辑器使用 • bydreamxxx 回复了问题 • 3 人关注 • 3 个回复 • 905 次浏览 • 2023-10-26 12:51