View Full Version : Torque Menu System
pjrulze
08-30-2006, 01:21 AM
Hey everyone,
Is there a way to get movie files (eg, mpeg, .mov or avi) to work in the opening menu system in TGE (Torque Game Engine)? All of the information that I have turned up is only pointing to jpegs and png files. Keep in mind that I am not a programmer, and don't know much aside from the drag and drop basics that come packaged with TGE. However, we do have a programmer, and if there is a programming solution, please let me know.
Cheers in advance
Pj
zoombapup
08-30-2006, 01:49 AM
Have a look at the guiTheoraCtrl, its basically a player for ogg/theora movies (do a google on theora).
stanchat
08-30-2006, 01:52 AM
This is from their site: http://tdn.garagegames.com/wiki/GUI/Video
http://tdn.garagegames.com/wiki/Image:theoraGoodies.zip
If you are registered you should have no problems using these. I have never used these before since I am new to Torque myself, just ran across this weekend and it sounded like it would do what you need.
GUI/Video
From TDN
[edit]Overview
We're using the excellent Ogg Vorbis and Theora codecs. They're fast, free, and cross-platform. Thank you, Xiph.org! All the decoding and streaming happens in a background thread, rendering via an optimized YUV->RGB converter to an OpenGL texture, so the core functionality can be applied to any GL-rendered object - which for Torque, is everything from GUI to grenades. All of the Ogg codecs are free for use, meaning you don't have to pay any license fees to use them in your game. Theora.org has information about how to encode videos to Theora format.
[edit]Setup
Torque now supports playback of the Ogg Theora video codec, by Xiph.org, the fine people who brought us Ogg Vorbis, an excellent audio codec. The size and weight of the video will affect the performance of your menu, so be considerate of older computers.
theoraGoodies
[edit]GuiTheoraCtrl
Video playback in a GUI may be accomplished by using the GuiTheoraCtrl - just call setFile on it, passing it the path of the video file, and it will play it. If you're interested in integrating the playback in other areas of the engine, look at the TheoraTexture class - it manages rendering Theora video to a GL texture, which can then be rendered or otherwise used.
So you should have something like this:
new GuiTheoraCtrl(MyVideo) {
profile = "GuiDefaultProfile";
horizSizing = "relative";
vertSizing = "relative";
position = "40 25";
extent = "320 240";
minExtent = "8 2";
visible = "1";
done = "0";
stopOnSleep = "1";
backgroundColor = "0 0 0 255";
};
Go to the Console and use this command:
MyVideo.setFile("starter.fps/data/video/menuvideo.ogg");
To stop the video use, stop() on the GuiTheoraCtrl. You can set this command to be a button.
The next best thing is to script this input to a button or startup. See the demo game data's GUI buttons to see this in action. Full controls have yet to be documented.
Retrieved from "http://tdn.garagegames.com/wiki/GUI/Video"
--------------------------------------------------------------------------------
pjrulze
09-04-2006, 07:02 PM
Cheers for the help guys. My team and I had a look at the Theora codec on Thursday last week and were really impressed by its compression capabilities, and its incorporation into TGE. This was a big plus for us, as we always wanted something moving in the background of our menu system so that it didn't appear to the static. Cheers for teh assistance.
Pj
TAFE Student - Adelaide
pjrulze
09-12-2006, 09:39 PM
Alrighty then, the theora gear works a treat, the compression is good, with minimal quality loss, but we still have one problem, on most of our conversions form .avi or .mpeg into a theora clip, we have this crappy green band either on the bottom of the render or the right hand side that isn't there in the uncompressed version. Any thoughts on why this is occuring? And is there any way we can stop this from happening (yes we know we can hide it in behind something in the menu system, but that doesn't solve the problem in the long run). Cheers in advance.
Paul
zoombapup
09-13-2006, 03:06 AM
Could be padding the screen area out to make it power of two or some such?
Try making your avi's a power of two size and see if you still get a band?
pjrulze
09-20-2006, 05:10 PM
After having tried all types of sizes, PAL, NTSC, different bitrates, it seems that the answer lies with sound. If we convert a file without sound, we get that stupid little green band, assumedly because it is compensating for the lack of sound and adding some data to make up for it. If we convert a file into a Theora video with sound, it doesn't matter what size, bitrate or frames per second it is, the green band isn't there. Hopefully this helps anyone else who has come across the same problem, or if there is another solution, please, let me know.
Paul
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.