Flash Player 11 中的 Stage3D 不显示
我正在尝试使用 Stage3D API 在 ActionScript 3.0 中编写 3D 游戏。我已将 playerglobal.swc
复制到 frameworks/libs/player/11.0
目录中,并修改了 frameworks/flex-config.xml
将 target-player
更改为 11.0.0
,将 swf-version
更改为 13
。
当我使用 mxmlc
编译 ActionScript 3.0 文件时,我设置了选项 -target-player=11.0.0
和 -static-link-runtime-shared-libraries=正确。现在,在导入
com.adobe.utils.AGALMiniAssembler
或 flash.display.Stage3D
时,我在编译时没有收到错误,因此我认为这没有问题。
我在 Opera 中运行编译后的 SWF 文件,并且使用今天公开发布的最新 Flash Player(版本 11.0.1.152)(干杯;D)。播放器似乎没有问题,因为我可以玩僵尸大亨。但是,当我播放 SWF 文件时,Stage3D 不显示;但附加到舞台的所有其他显示对象都会显示。
我相信我的配置或代码有问题,但我无法查明它。我使用的代码只是从 实验室复制而来@Jam3。我认为视口存在一些问题,所以我只是将 stage.stage3Ds[0].viewPort=new Rectangle(0, 0, 980, 570);
替换为 stage.stage3Ds [0].x=0; stage.stage3Ds[0].y=0;
。也许,这就是问题的原因。
我一直在网上寻找解决方案,但似乎找不到。任何帮助将不胜感激。但请注意,我不希望使用像 Away3D 这样的框架,因为我希望使用低级功能(我更喜欢编程)。如果您想了解更多详细信息,请询问。
I'm trying to write a 3D game in ActionScript 3.0 using the Stage3D API. I've copied the playerglobal.swc
in my frameworks/libs/player/11.0
directory, and modified the frameworks/flex-config.xml
file by changing the target-player
to 11.0.0
and the swf-version
to 13
.
When I compile my ActionScript 3.0 files using mxmlc
I set the options -target-player=11.0.0
and -static-link-runtime-shared-libraries=true
. Now, I don't get an error at compile time when importing com.adobe.utils.AGALMiniAssembler
or flash.display.Stage3D
so I assume that there's no problem with that.
I run the compiled SWF file in Opera, and I'm using the latest Flash Player (version 11.0.1.152) which was publicly released today (cheers ;D). There's seems to be no problem with the player because I can play Zombie Tycoon. However, when I play my SWF file the Stage3D doesn't display; but all the other display objects attached to the stage do display.
I believe that there's either some problem with my configuration or my code, but I can't pinpoint it. The code I'm using was simply copied from Labs @ Jam3. I believe that there was some problem with the viewport, so I simply replaced stage.stage3Ds[0].viewPort=new Rectangle(0, 0, 980, 570);
with stage.stage3Ds[0].x=0; stage.stage3Ds[0].y=0;
. Perhaps, that's the cause of the problem.
I have been searching for a solution all over the web, but I can't seem to locate it. Any help will be appreciated. Note however that I don't wish to use frameworks like Away3D because I wish to use the low-level functionality (I'm more into programming). If you want any more details, please ask.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@Miha - 感谢您回答我的问题。我将
wmode
参数设置为direct
,效果非常好。显然,Stage3D API 无法在透明
、不透明
或窗口
模式下工作。如果有人遇到类似问题,这里是我的 HTML 代码,它解决了该问题:要使用 Stage3D API,您必须将
wmode
参数设置为direct
。其他的都行不通。 9号线是必要的。@Miha - Thank you for answering my question. I set the
wmode
parameter todirect
, and it worked like a charm. Apparently, the Stage3D API doesn't work intransparent
,opaque
, orwindow
mode. If anyone is having similar problems, here's my HTML code which solved the problem:To use the Stage3D API, you have to set the
wmode
parameter todirect
. Nothing else will work. Line 9 is necessary.