如何开发需要两个独立显示器的交互式信息亭。 (最好是闪光灯)
情况如下:
我需要为交互式信息亭创建游戏。
这个游戏是相当基础的,它很可能是在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
正如您所提到的,像素完美,您可以运行分屏显示。
另一种方法可以利用 Flash LocalConnection:
http:// /help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/LocalConnection.html
通过中央控制器,可以使用 LocalConnection 作为通信管道来维护两个应用程序之间的显示同步。
或者,您可以安装两个 Flash 应用程序通过其进行通信的主机服务器。
如果构建在 Adobe 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
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.
最简单的方法可能是使用某种类似 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).
flixel 框架具有分屏相机功能:http://flixel.org/features.html
The flixel framework has a splitscreen camera feature: http://flixel.org/features.html
如果您能够在 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