如何开发需要两个独立显示器的交互式信息亭。 (最好是闪光灯)

发布于 2024-12-11 07:49:38 字数 599 浏览 0 评论 0原文

情况如下:

  • 我需要为交互式信息亭创建游戏。

  • 这个游戏是相当基础的,它很可能是在 flash/AS3 中完成的(我相信这个 是此类游戏的最佳选择)除非双显示器 使用不同的技术更容易满足要求。

  • 信息亭由两个显示器组成,两个显示器都需要显示 将同一游戏中的内容分开。

问题如下:

我(或任何人)如何创建一个 Flash 游戏,利用两个单独的显示器来显示不同的内容? (这不仅仅是游戏视野更广阔,两个屏幕会显示不同的东西。)

我要求的是一种方法来做到这一点,而不是有关游戏编码的信息。

[编辑]我的想法(可能不是最好的):

在画布上设计游戏,画布的宽度是其中一台显示器的两倍,然后将画布分成两半并对游戏进行编码以向每个显示器输出不同的内容屏幕的一半。然后以“扩展桌面”模式或类似模式运行显示器,并确保两个桌面之间的分割发生在游戏画布的中间。

[编辑] 两个显示器由同一台机器和同一图形适配器供电。整个“信息亭”由一台机器供电。

Here's the situation:

  • I need to create a game for an interactive kiosk.

  • The game is fairly basic, it will most likely be done in flash/AS3 (I believe this
    is the best choice for this kind of game) UNLESS the dual display
    requirement is far easier to accomplish with a different technology.

  • The kiosk consists of two displays, both of which need to show
    separate content from within the same game.

Here's the question:

How can I (or anyone) create a flash game that utilizes two separate displays for different content? (This is not just a wider field of vision for the game, the two screens will show different things.)

I am asking for a method by which to do this, not for information about coding the game.

[EDIT] My Idea (probably not the best):

Design the game on a canvas twice as wide as one of the monitors, then split the canvas in half and code the game to output different things to each half of the screen. Then run the monitors in "extended desktop" mode or something like that, and make sure that the split between the two desktops occurs in the middle of the game canvas.

[EDIT] The two displays are being fed from the same machine and same graphics adapter. The whole "kiosk" is powered by one single machine.

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

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

发布评论

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

评论(4

束缚m 2024-12-18 07:49:38

正如您所提到的,像素完美,您可以运行分屏显示。

另一种方法可以利用 Flash LocalConnection:

http:// /help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/LocalConnection.html

LocalConnection 对象只能在以下文件之间进行通信
运行在同一台客户端计算机上,但它们可以运行在
不同的应用程序 - 例如,在浏览器中运行的文件和
在 Adob​​e AIR 中运行的 SWF 文件

通过中央控制器,可以使用 LocalConnection 作为通信管道来维护两个应用程序之间的显示同步。

或者,您可以安装两个 Flash 应用程序通过其进行通信的主机服务器。

如果构建在 Adob​​e AIR 中,两个应用程序可以使用 flash.net.ServerSocket 进行点对点通信。

Pixel perfect, you could run a split screen display, as you've mentioned.

Another approach could be leveraging Flash LocalConnection:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/LocalConnection.html

LocalConnection objects can communicate only among files that are
running on the same client computer, but they can be running in
different applications — for example, a file running in a browser and
a SWF file running in Adobe AIR

Via a central controller, synchronization between displays could be maintained for both applications with LocalConnection serving as a communications pipeline.

Or, you could install a host server that both Flash applications communicate through.

If built in Adobe AIR, two applications could communicate peer-to-peer using flash.net.ServerSocket.

平定天下 2024-12-18 07:49:38

最简单的方法可能是使用某种类似 MVC 的设计。将游戏逻辑与显示(MovieClip 实例)分开,并让每个屏幕单独渲染自己的视图。

因此,在这个解决方案中,您将拥有某种包含实际游戏数据的模型类,每个“屏幕”都会戳数据并绘制它需要绘制的任何内容。

这就是 MVC 的优点——将“我的游戏(状态)是什么”(模型)与“我如何在这里绘制游戏的 X 方面”(视图)等问题分开。

The easiest way is probably with some sort of MVC-like design. Separate your game logic from your display (MovieClip instances), and get each screen to render its own view separately.

So in this solution, you'll have some sort of Model class with the actual game data, and each "screen" will poke the data and draw whatever stuff it needs to draw.

This is what MVC is supposed to be good for -- separating concerns like "what is my game (state)" (model) vs. "how do I draw X aspects of my game here" (view).

水中月 2024-12-18 07:49:38

flixel 框架具有分屏相机功能:http://flixel.org/features.html

The flixel framework has a splitscreen camera feature: http://flixel.org/features.html

北城半夏 2024-12-18 07:49:38

如果您能够在 Web 浏览器中运行 Flash 应用程序,您也许能够摆脱 Flash 和 Javascript 之间的数据传递,然后在浏览器窗口之间传递 Javascript 数据(并全屏运行浏览器以进行演示) 。

所以,基本上,窗口 1 上的 Flash ->窗口 1 上的 JavaScript -> Window 2 上的 JavaScript ->窗口 2 上闪烁

If you're able to run the flash application inside a web browser, you might be able to get away with datapassing between Flash and Javascript, and then pass Javascript data between browser windows (and run the browsers full screen for the sake of presentation).

So, basically, Flash on Window 1-> Javascript on Window 1 -> Javascript on Window 2 -> Flash on Window 2

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