Displaying HTML inside of Torque?
by Dreamer · in Torque Game Engine · 04/22/2005 (7:41 am) · 42 replies
I'm just wondering if anyone has ever gotten HTML to display inside of a Torque window.
I know we can open a webbrowser while playing, but this has issues when a game is running full screen in linux under KDE (It makes the game appear to freeze, when in reality we have just given focus to a child window rendered behind the full screen game).
Anyways this functionality could be useful for a number of reasons, but my thinking is to replace the current help system, with a dynamically updated help from my website.
Thoughts?
I know we can open a webbrowser while playing, but this has issues when a game is running full screen in linux under KDE (It makes the game appear to freeze, when in reality we have just given focus to a child window rendered behind the full screen game).
Anyways this functionality could be useful for a number of reasons, but my thinking is to replace the current help system, with a dynamically updated help from my website.
Thoughts?
#2
04/24/2005 (5:50 pm)
I'd suggest using the ML control to do this, and exporting stuff in ML. It's not great but it's good enough for lightweight in-game displays.
#3
04/25/2005 (2:36 am)
Where can I get more info on ML and the ML control system?
#4
04/25/2005 (3:21 pm)
Look at GuiMLTextControl?
#5
04/25/2005 (3:42 pm)
ML = MultiLine btw
#6
Just an idea. :)
04/25/2005 (3:58 pm)
I think it would be very interesting if somebody were to create a TGE resource to use Mozilla's Gecko engine to do HTML rendering inside of Torque. I have no idea how hard it would be to pull off since I've never looked into how Mozilla and Gecko were interfaced. Could be a good path to go down and get a real web browser engine inside of your game.Just an idea. :)
#7
04/25/2005 (7:27 pm)
It's a great idea, and ridiculously complex. If someone has a working such implementation, let us know! :)
#8
04/25/2005 (8:07 pm)
@Ben maybe it's not so far off, the QT toolkit has a fairly decent crossplatform HTML renderer, with a super simple interface, and I'm pretty sure I could get it to link into a torque app (at least on a linux box). Only problem is I'ld need to buy a license to create something that could be redistributable. :(
#9
04/25/2005 (11:37 pm)
Nevermind that getting it to render to a GL context at any speed is going to be an exercise in pain... Of course, you could port it to doing rendering via GL entirely but that's a LOT of work. Trust me, I've looked hard at this problem.
#10
04/26/2005 (4:37 am)
Ok, Ok so thats not such a great option, oh well time to figure something else out for this portion of the game.
#11
04/26/2005 (5:35 am)
It looked to me like Half-Life 2 is using the IE control for things like MOTD rendering. Anyone know for certain? (If that's the case, it kinda gives me the creeps, given IE's security record.)
#12
@Dreamer: at a first glance ML seems to be quite similar to HTML; couldn't you just serve ML from your server and put it in some UI control?
My impression from the menus of the demo was that ML is sufficient for most of the things that I would intend to do with text in a game.
04/26/2005 (6:16 am)
@Kenneth: I am quite sure HL2 does not.@Dreamer: at a first glance ML seems to be quite similar to HTML; couldn't you just serve ML from your server and put it in some UI control?
My impression from the menus of the demo was that ML is sufficient for most of the things that I would intend to do with text in a game.
#13
04/26/2005 (6:28 am)
Bah! I'm still trying to find an existing GUI control using ML, from which to figure this same thing out, yes serving ML would be pretty trivial for a PHP app to do, but I need to see a currently functioning GUIMLControl to figure out what needs done.
#14
04/26/2005 (8:44 am)
Isn't it GuiMLTextCtrl??
#15
04/26/2005 (9:23 am)
What should have said is I am looking for somewhere in code that a ML based control is currently being implemented, so I can look at the implementation and learn from it, thats really the quickest way for me to do that sort of thing.
#16
04/26/2005 (10:09 am)
Look at the help screen. Press F1.
#17
04/26/2005 (10:13 am)
Ahh ok, it was right infront of me and I wasn't seeing it, thanks!
#18
04/26/2005 (10:19 am)
Glad you found it... would be interested in seeing the results.
#19
04/26/2005 (10:59 am)
This is kinda cool, I just took a good long hard look at the RPGDialog resource, and noticed that I may be able to adapt it to display short small webpages, this opens up a whole world of possibilities :)
#20
News GUI control for receiving news content from a web server
04/26/2005 (3:41 pm)
Also you might find my first and only popular resource useful (shameless plug)News GUI control for receiving news content from a web server
Torque Owner Sam3d
You should be able to update the contents of a popup gui with a call to your server.
If you have php on it, shoudn't be too hard.
function getPhp(){ %server = "www.your server.com:80"; %serverpath = "/"; %requeststring = "/hello.php"; %upd = new HTTPObject(showPhp){}; %upd.post(%server, %serverpath @ %requeststring, "", %upd); } function showPhp::onLine( %this, %line) { echo("server pinged"); echo("reply is: " @ %line); } the hello php file... <? echo("hello from remote server"); ?>