Flash Player 11 中的 Stage3D 不显示

发布于 2024-12-07 21:20:42 字数 1142 浏览 0 评论 0原文

我正在尝试使用 Stage3D API 在 ActionScript 3.0 中编写 3D 游戏。我已将 playerglobal.swc 复制到 frameworks/libs/player/11.0 目录中,并修改了 frameworks/flex-config.xmltarget-player 更改为 11.0.0,将 swf-version 更改为 13

当我使用 mxmlc 编译 ActionScript 3.0 文件时,我设置了选项 -target-player=11.0.0-static-link-runtime-shared-libraries=正确。现在,在导入 com.adobe.utils.AGALMiniAssemblerflash.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅浅淡淡 2024-12-14 21:20:42

@Miha - 感谢您回答我的问题。我将 wmode 参数设置为 direct,效果非常好。显然,Stage3D API 无法在透明不透明窗口 模式下工作。如果有人遇到类似问题,这里是我的 HTML 代码,它解决了该问题:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8"\>
    <title>Hello Stage3D!</title>
  </head>
  <body>
    <object width="800" height="600" data="HelloStage3D.swf">
      <param name="wmode" value="direct"/>
    </object>
  </body>
</html>

要使用 Stage3D API,您必须将 wmode 参数设置为 direct。其他的都行不通。 9号线是必要的。

@Miha - Thank you for answering my question. I set the wmode parameter to direct, and it worked like a charm. Apparently, the Stage3D API doesn't work in transparent, opaque, or window mode. If anyone is having similar problems, here's my HTML code which solved the problem:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8"\>
    <title>Hello Stage3D!</title>
  </head>
  <body>
    <object width="800" height="600" data="HelloStage3D.swf">
      <param name="wmode" value="direct"/>
    </object>
  </body>
</html>

To use the Stage3D API, you have to set the wmode parameter to direct. Nothing else will work. Line 9 is necessary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文