有个困惑, spine导出的文件在cocos中可以按照spine里面的原点坐标放入背景图的正中心即可完美契合。
但是用在UE5里面就不行了, UE5不能好像不能识别spine里面的原点坐标,UE5只识别初始加载的图片大小,放入图片的正中心就不能与背景图契合。
望讲解。
有个困惑, spine导出的文件在cocos中可以按照spine里面的原点坐标放入背景图的正中心即可完美契合。
但是用在UE5里面就不行了, UE5不能好像不能识别spine里面的原点坐标,UE5只识别初始加载的图片大小,放入图片的正中心就不能与背景图契合。
望讲解。
在UE中就下面很大一块空直接刨除掉了, 因为有很多这种战斗场景,不可能每个都手动对齐, 所以打算所有战斗场景放入各自背景图片的正中央就可以和背景图契合。
您正在使用“大小到内容”标志,并期望骨架中的空白空间(我的屏幕截图中的绿色框)得到考虑。 但 Spine 运行时只知道屏幕截图中的蓝色框,因为它是设置姿势中可见附件周围的边界框。 当您创建“SpineWidget”时,该小部件必须告诉 UE 它的大小。 小部件只知道蓝色框,所以这就是它报告的内容。 “大小到内容”标志只会将小部件扩展或缩小到蓝色框。
恐怕这是 UE Slat/UI 框架的限制。 我不确定我们能否在一般情况下解决这个问题。 您可以编写一个函数,通过获取其设置姿势边界框并将从 (0,0) 的偏移量添加到边界框的下边缘,将小部件偏移 y 轴上的空白空间。
You are using the "size to content" flag and expect the empty space in your skeleton (green box in my screenshot) to be accounted for. But the Spine Runtime only knows about the blue box in the screenshot, as that that is the bounding box around the visible attachments in the setup pose. When you create a SpineWidget
, the widget has to tell UE its size. The widget only knows about the blue box, so that is what it reports. The "size to content" flag will only expand or shrink the widget to the blue box.
I'm afraid that is a limitation of UE Slat/UI framework. I'm not sure we can fix this on our end in the general case. You could write a function that offsets the widget by the empty space on the y-axis by taking its setup pose bounding box and adding the offset from (0,0) to the lower edge of the bounding box.