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

标签 flash position export sprite-sheet flash-cs6

我正在尝试调整 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/

相关文章:

css - 如何在 Flash 应用程序中使用 "native"自定义鼠标光标?

css - 如何定位到文本的左侧

html - 两个具有静态宽度的 DIV 1,其他的 fliud,但是如何让正确的 div 堆叠在@断点下?

mysql - phpMyAdmin 4.0.5 导出错误错误 - 有人知道它是否正在解决吗?

flash - 将每一帧渲染为单个图像

flash - 支持密码保护的任何 AS3/Air Library for Zip 文件

flash - 点下或形状下的颜色

html - 使用 CSS 将图像定位在以下 <div> 之上

c - 有没有办法知道目标文件中导出了哪些符号?

bash 脚本在它打开的奇点容器中执行操作