- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试调整 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/
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 7 年前。 Improve
我正在使用 SDL2 用 C 语言开发游戏,我的问题是该游戏是全高清的,并且具有长(180 帧)角色动画,会生成非常大的 Sprite 表。我有一个 7326x7250px 的 Sprite 表,我必
我有一个 spritesheet (9170px x 350px),其中包含 70 帧单个字符。这是我的代码。 @-webkit-keyframes play { 100% { backg
我在纹理打包器的帮助下生成了一个 CSS Spritesheet,它看起来像 .pirateSlotSprite {display:inline-block; overflow:hidden; bac
“简单”问题。 为站点元素使用大型 spritesheet 是否比使用多张图片更好? 我的意思是,额外的 CSS 图像处理(背景定位大图像并裁剪它)是否弥补了较少的 HTTP 图像请求? 最佳答案 n
我到处都能找到有关如何使用从 zwoptex 创建的文件运行动画的代码,但它使用的是已弃用的代码。我找不到有关如何使用 CCSpriteBatchNode 运行动画的代码。 有什么建议吗? 最佳答案
我有一个小问题,我使用的是多行 Spritesheet,其中每一行都是图像序列。 但是我无法让 Sprite 表从不同的高度开始(因此它可以向下移动),它们都从顶 Angular 开始 var sp
尝试在我的游戏中添加爆炸动画,但由于某种原因只播放 Sprite 的第一帧。 Spritesheet 在预加载器中加载。 这是调用动画的函数 function asteroidCollisionHan
我有一个 spritesheet 驱动一组按钮的外观,这些按钮会根据各种鼠标操作而变化。但是,在 sprite 之间切换时我可以看到闪烁,并且在 chrome 或 firebug 中查看网络面板确认每
目前,我有一个菜单场景,我在其中将 spritesheet 添加到帧缓存中。我反复离开菜单场景并返回。因此,每次重新加载菜单场景时,都会将相同的 spritesheet 添加到帧缓存中。这是坏事吗?旧
我创建了一个 spritesheet;在桌面上一切正常。但是,然后我尝试在我的 iPhone 5s 上查看它,它显示正常,但是当单击图像时,会立即出现一个深灰色框。我立即想到也许我有冲突的 CSS,但
我有一个描述 Sprite 表中 Sprite 的 xml 文件:
下面的代码片段应该播放 1-3 帧 3 次,并且(在我看来)在第 3 帧结束,而不是在完成后显示第 4 帧,这在之前的 3 次迭代中没有动画。 由于这在 Chrome、Safari 和 FF 中同样有
我有一个 Sprite 表,宽度为 5760 像素,高度为 5400 像素,包含 10 行和 6 列,每列宽度为 960 像素,高度为 540 像素。 Sprite 表中的所有 Sprite 都是从左
所以我为我正在制作的游戏制作了一个 sprite 表动画,但由于某种原因它远远落后于我的游戏。 Sprite 表是一个 1248x120 .png 文件,每个 Sprite 的大小为 156x120
我正在尝试使用 spritesheet 制作 Logo 动画,效果很好。代码就像 #logo { background: url('../img/logo.png'); height: 142
我的游戏有问题,这不是错误而是问题。我正在使用 spritesheets 来制作我的游戏并使用 for 循环自动调用我的 Platform 类。但是,当我尝试调用平台类时,它只显示整个 sprites
我想为我的图标使用 CSS Spritesheet。每个图标图像的大小为 48x48px。但是,我希望能够显示任意尺寸的图标。 现在,我正在使用,显示一个 24x24 图标,我使用: 有没有更短
我正在使用 Python 和 Pygame 开发游戏。我为其中一个敌人创建了一个 sprite 表,并让它运行了我的代码。问题是图像看起来有黑色背景,即使它是透明图像。它的代码是这样的: en
我正在尝试从 spritesheet 中选择背景图像的一部分,填充其容器中的整个空间。 在这支笔中,背景图像应始终填充字符。也在调整大小时,这是主要问题。 https://codepen.io/tim
我是一名优秀的程序员,十分优秀!