gpt4 book ai didi

flash - Flash CS6 Spritesheet导出功能中如何设置注册点?

转载 作者:行者123 更新时间:2023-12-02 00:18:31 28 4
gpt4 key购买 nike

我正在尝试调整 Spritesheet 导出的 JSON 文件,以便我可以导入 Sprite 及其在它们的注册点的位置。

在 Flash 中,我只是将 offset 添加到 position 中,这是 frame.offsetInSource 但这不起作用...这是我现在如何导出它:

function frameExport(frame)
{

var s;
if (hitFrame)
s = "\n,{\n";
else
s = "\n{\n";
s += AddKeyRect("frame", frame.frame);
s+= ",\n";
var spriteSourceSize = new Object();
spriteSourceSize.x = frame.offsetInSource.x;
spriteSourceSize.y = frame.offsetInSource.y;
spriteSourceSize.w = frame.sourceSize.w;
spriteSourceSize.h = frame.sourceSize.h;
s += AddKeyRect("offset", spriteSourceSize);
s += "}";

hitFrame = true;

return s;
}

我怎样才能以好的方式导出它,使它们的相对位置也导出为偏移变量?还有其他变量可以用于此吗?我知道您可以使用这些变量:

frame.frame.x
frame.frame.y
frame.frame.w
frame.frame.h
frame.offsetInSource.x
frame.offsetInSource.y
frame.sourceSize.w
frame.sourceSize.h

提前致谢!

最佳答案

我还尝试使用 Sprite Sheet Exporter 来导出每一帧的相对位置。但我发现,在元数据中,“frame.offsetInSource.x”的值始终为零。我想这就是我想要的,也是你想要的。

我尝试编辑 JSON.plugin.jsfl,取消注释。遗憾的是它仍然是零。

到现在为止,我还没有弄明白为什么。

关于flash - Flash CS6 Spritesheet导出功能中如何设置注册点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11925100/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com