我可以在 Unity 窗口上覆盖 HTML 吗?

发布于 2024-11-29 23:38:18 字数 242 浏览 0 评论 0原文

我正在开发一个在 Unity 窗口中显示丰富内容的网站。但是,此 Unity 窗口位于具有下拉菜单的导航菜单下方,并且下拉菜单位于 Unity 窗口后面。

对于 Flash,通过将 wmode 属性设置为 transparent 可以轻松解决此问题。 Unity 是否有类似的解决方案,或者完全不同的解决方案可以工作并允许我将标准 HTML 放置在 Unity 窗口的顶部?

提前致谢。

I'm working on a website that has rich content displayed in a Unity window. However, this Unity window sits under a navigation menu that has drop-downs, and drop-down menus are going behind the Unity window.

With Flash, this was easily solved by setting the wmode property to transparent. Is there a similar solution with Unity, or a different solution entirely that works and allows me to place standard HTML over the top of Unity windows?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

笑脸一如从前 2024-12-06 23:38:18

unity 论坛上的一些相关帖子

http://forum.unity3d .com/threads/22270-Unity-Flash-Div-issue-in-Browser

http://answers.unity3d .com/questions/10599/does-unity-have-an-embed-parameter-equivalent-to-f.html

答案:没有办法设置一些相当于 flash wmode=transparent 但有一个解决方法,可以设置 css visibility:hidden (或调整大小为 width:1px & code>height:1px)

因此,这是一种 hack,但您可以设置菜单的 hover 事件来更改统一窗口的 可见性 作为解决方法。

Some related posts on unity forums

http://forum.unity3d.com/threads/22270-Unity-Flash-Div-issue-in-Browser

http://answers.unity3d.com/questions/10599/does-unity-have-an-embed-parameter-equivalent-to-f.html

The answer: there isn't a way to set some equivalent of the flash wmode=transparent but there is a workaround with setting the css visibility:hidden (or resizing to width:1px & height:1px)

So, kind of a hack, but you could set the menu's hover event to change visibility of the unity window as a workaround.

栖迟 2024-12-06 23:38:18

老帖子,但这可能对某人有帮助。
我可以让 HTML 在 Mac 上的 Safari、Chrome、Firefox 和 Windows IE 10 和 Windows 上的 Unity 窗口上显示。 11 带 div。我可以让它在所有窗口中始终显示 iFrame。 iFrame 的技巧是并非所有浏览器都支持透明 iFrame,因此有时您会看到 iFrame,但不是透明的。 IE 8 根本不支持透明度,如果将其设置为打开,则 iFrame 将不会显示在 Unity 屏幕上方。

分区:
我基本上将 DIV 浮动在统一内容上。内容可以是纯 HTML 或 Flash。不透明似乎有助于使其发挥作用。
我的情况是我们有一个菜单需要显示在 Unity 窗口的顶部。请注意,Unity 不处于全屏模式,而是位于 Div 中。也许这就是我能做到的原因?
无论如何 - 代码看起来像这样:

<div>
   <div><unity object></div>
   <div style="position:absolute; opacity:.9">html or flash content</div>
</div>

iFrame 方法对于始终相同大小的内容效果很好,但如果您有类似组合框的内容,那么它是一个问题,因为窗口需要首先调整高度大小以显示下拉菜单,然后iFrame背景将覆盖所有内容。一个技巧是使用组合框打开第二个 iframe。很糟糕,但这就是我必须这样做的方式..

hth-
达斯汀

Old post, but this might help someone.
I can get HTML to display over the Unity window in Safari, Chrome, Firefox on my Mac and Windows IE 10 & 11 with a div. I can get it to always display with an iFrame in all windows. The trick with the iFrame is not all browsers support transparent iFrame, so sometimes you will see the iFrame, but not transparent. IE 8 does not support transparency at all and if its set to be on, then the iFrame will not display above the Unity screen.

DIV:
I basically float a DIV over the unity content. Content can be either plain HTML or Flash. Opacity seems to help make it work.
My situation is we have a menu that needs to display over the top part of the Unity window. Note that Unity is NOT in full screen mode, but sits in a Div. Maybe this is why I can do it??
Anyway- the code looks something like this:

<div>
   <div><unity object></div>
   <div style="position:absolute; opacity:.9">html or flash content</div>
</div>

The iFrame approach works fine for content that is always the same size, but if you have something like a combobox, then its an issue because the window needs to first resize the height to show the drop down, and then the iFrame background will cover all the content. A hack, is to open a SECOND iframe with the combobox. Sucks, but that is the way I had to do it..

hth-
Dustin

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