【问题标题】:starling atf textures not displaying八哥 atf 纹理不显示
【发布时间】:2013-07-06 08:12:39
【问题描述】:

所以我正在运行最新的 starling 框架 air 3.7,在编译器参数中添加了 -swf-version=20 -target-player=11.7 并运行代码

[Embed(source="/assets/wtf4.atf", mimeType="application/octet-stream")]
private static const why:Class;

var data:ByteArray = new why();
var texture:starling.textures.Texture = starling.textures.Texture.fromAtfData(data);
var image:Image = new Image(texture);
addChild(image);

如果我使用的是框架演示附带的 starling atf,它可以正常工作,但是每当我尝试显示我在 photoshop 中创建的转换为 atf 的自己的 png 时,它会给我一个错误提示

ArgumentError:错误 #3677:纹理解码失败。内部错误。

我试图转换为 atf 的图像只是一个红色方形 png,大小为 512x512,编译器参数为:png2atf -c -i example.png -o example.atf。我不确定我的闪存构建器是否没有设置为解码 atfs,或者我是否出于某种原因创建了错误的 atfs,如果有人能对此有所了解,那就太棒了!

【问题讨论】:

  • 我不想阻止您在这里提问,因为这是一个合理的问题,但您可能会在 Starling 论坛上收到更快的回复:forum.starling-framework.org

标签: actionscript-3 textures


【解决方案1】:

在创建 .atf 时,您是否也创建了 mipmap?如果不是,您需要将 Texture.fromAtfData() 函数的第二个参数设置为 false - 不要使用 Mipmap。

来自 Starlign 维基:

“如果省略mipmaps,则必须将“Texture.fromAtfData()”方法的参数“useMipMaps”设置为“false”!否则会出现运行时错误。”

http://wiki.starling-framework.org/manual/atf_textures

【讨论】:

  • 我已经为各种 mipmap 尝试了这两个参数,但这似乎不是解决方案。
  • @user1573274 你用什么工具来制作aft文件?
【解决方案2】:

最新版本的 ATF 需要 AIR 3.8(目前处于测试阶段)。您需要下载 AIR 安装程序和最新的 AIR SDK。更多细节在这里:http://forum.starling-framework.org/topic/error-3677-texture-decoding-failed-internal-error

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-10
    • 2015-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多