GuiTheoraCtrl and TGB - New Forum
by Andy Hawkins · in Torque Game Builder · 08/05/2006 (7:10 pm) · 4 replies
I'm trying to implement this resource into TGB
GuiTheoraCtrl
I did this by...
1. installing the OGG codecs found here...
Theora Goodies
2. starting a new TGB project and calling it VideoTest
3. converted an MPG using ffmpeg2theora-0.13.exe to an OGG
4. copied the resultant OGG video to "C:\Program Files\TorqueGameBuilderPro\games\VideoTest\data\video"
5. opened up game.cs in my "VideoTest\gameScripts" folder and added the following code...where the // MYCODE is...
6. I ran the game and checked the console and it said this...
and the video doesn't play. When I press F10 and attempt to add it manual in the GUI editor it has lost it's parameters and resets the position and screen size to the size of the screen.
The Set::getObject index gives a clue - but as there isn't any more documentation that I can see on the TDN resource I'm stuck.
Is this GuiTheoraCtrl meant to work in TGB? Any assistance would be appreciated.
GuiTheoraCtrl
I did this by...
1. installing the OGG codecs found here...
Theora Goodies
2. starting a new TGB project and calling it VideoTest
3. converted an MPG using ffmpeg2theora-0.13.exe to an OGG
4. copied the resultant OGG video to "C:\Program Files\TorqueGameBuilderPro\games\VideoTest\data\video"
5. opened up game.cs in my "VideoTest\gameScripts" folder and added the following code...where the // MYCODE is...
function startGame(%level)
{
// Set The GUI.
Canvas.setContent(mainScreenGui);
Canvas.setCursor(DefaultCursor);
moveMap.push();
if( isFile( %level ) || isFile( %level @ ".dso"))
sceneWindow2D.loadLevel(%level);
// MYCODE
new GuiTheoraCtrl(MyVideo) {
profile = "GuiDefaultProfile";
horizSizing = "relative";
vertSizing = "relative";
position = "340 325";
extent = "384 288";
minExtent = "8 2";
visible = "1";
done = "0";
stopOnSleep = "1";
backgroundColor = "0 0 0 255";
};
if ($playingVideo != 1)
{
$playingVideo = 1;
MyVideo.setFile("C:/Program Files/TorqueGameBuilderPro/games/VideoTest/data/video/MOV03993.ogg");
}
// MYCODE
}6. I ran the game and checked the console and it said this...
Executing VideoTest/gameScripts/game.cs.
Executing VideoTest/Data/levels/untitled.t2d.
Executing VideoTest/managed/persistent.cs.
TheoraTexture - Loading file 'C:/Program Files/TorqueGameBuilderPro/games/VideoTest/data/video/MOV03993.ogg'
Ogg logical stream 7ae2 is Theora 384x288 25.00 fps video
- Frame content is 384x288 with offset (0,0).
Ogg logical stream 52d is Vorbis 2 channel 44100 Hz audio.
Set::getObject index out of range.
Set::getObject index out of range. and the video doesn't play. When I press F10 and attempt to add it manual in the GUI editor it has lost it's parameters and resets the position and screen size to the size of the screen.
The Set::getObject index gives a clue - but as there isn't any more documentation that I can see on the TDN resource I'm stuck.
Is this GuiTheoraCtrl meant to work in TGB? Any assistance would be appreciated.
#2
Anyway I checked the TGE resource for Theora video and the files that are used in the source code for 1.4 are identical (made by a guy called Shiny???) to the source files included in TGB - SOOOO for some reason Theora video support has been added to TGB but no bothered to mention it - or something.
I will investigate further - but it looks like I don't have to write a line of code - I just have to debug my current use of GuiTheoraCtrl (when I can get Express to compile it ... grrr) to find the solution...
So no-one out there is using TGB and Theora video yet???? Echo, echo, echo, echo.... :)
08/09/2006 (5:11 pm)
Well here I am again, talking to myself - offering myself answers :)Anyway I checked the TGE resource for Theora video and the files that are used in the source code for 1.4 are identical (made by a guy called Shiny???) to the source files included in TGB - SOOOO for some reason Theora video support has been added to TGB but no bothered to mention it - or something.
I will investigate further - but it looks like I don't have to write a line of code - I just have to debug my current use of GuiTheoraCtrl (when I can get Express to compile it ... grrr) to find the solution...
So no-one out there is using TGB and Theora video yet???? Echo, echo, echo, echo.... :)
#3
In the example code you posted above, you are creating the GuiTheoraCtrl... but you're not adding it to anything, so it won't display on screen at all, even though it is playing.
Add this line:
canvas.getContent().add(MyVideo);
After this line:
if ($playingVideo != 1) {
08/18/2006 (3:11 pm)
Yes Theora works fine with TGB.In the example code you posted above, you are creating the GuiTheoraCtrl... but you're not adding it to anything, so it won't display on screen at all, even though it is playing.
Add this line:
canvas.getContent().add(MyVideo);
After this line:
if ($playingVideo != 1) {
#4
08/18/2006 (11:41 pm)
Muh Hah! Thanks Harold - that'll do it.
Associate Andy Hawkins
DrewFX
I do not want to use the GuiAviBitmapCtrl because video will only work on Windows - I would appreciate any feedback on this. I would rather not have to reduce my videos to animated sprites.