Playing movie clips
by Josiah Trumpower · in Torque Game Engine Advanced · 01/06/2010 (4:31 pm) · 6 replies
I am wanting to play a movie clip in the game after/before a certain level. How can i do this?
About the author
#2
You'll need to make a new gui using a theora video.
Example:
01/27/2010 (11:30 am)
Are you talking about as a splash screen?You'll need to make a new gui using a theora video.
Example:
//--- OBJECT WRITE BEGIN ---
new GuiTheoraCtrl(Startup1Gui) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "640 480";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
theoraFile = "./myAwesomeMovie.ogg"; // Your movie to play
done = "0";
stopOnSleep = "1";
backgroundColor = "0 0 0 255";
// Not everyone wants to watch a movie. Mabe they have already seen it? or, just want to dive in and continue. Another problem torque has is it doesn't know when the movie is done playing. This button just allows you a way to continue.
new GuiBitmapButtonCtrl() {
Profile = "GuiButtonProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "463 439";
Extent = "140 30";
MinExtent = "8 8";
Visible = "1";
Command = "skipIt();"; // See the function below
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "./button";
helpTag = "0";
new GuiMLTextCtrl() {
Profile = "GuiMLTextNoSelectProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "75 10";
Extent = "300 19";
MinExtent = "8 2";
Visible = "1";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "<color:F6F4C4><shadowcolor:000000><shadow:1:1><font:Arial Bold:19>Skip"; // This is the text on the button
helpTag = "0";
allowSelection = "1";
};
};
};
//--- OBJECT WRITE END ---
function loadStartup1()
{
StartupGui.done = false;
Canvas.setContent( Startup1Gui );
schedule(100, 0, checkStartup1Done );
}
//-------------------------------------
function Startup1Gui::click()
{
StartupGui.done = true;
}
//-------------------------------------
function checkStartup1Done()
{
if (Startup1Gui.done)
{
echo ("*** Load Main Menu");
loadMainMenu();
}
else
schedule(100, 0, checkStartup1Done );
}
//My skip function to stop the video when the player wants to skip the splash screen
function skipIt()
{
Startup1Gui.stop();
loadMainMenu();
}Startup1 is the name of my gui. You can name it whatever you want.
#3
01/28/2010 (11:50 pm)
Where does the GUI stuff go? and then where do the functions go?
#4
Place it in "game/client/ui/"
In that same folder, find startup.gui and look twords the bottom.
Find: and change to:
Enter your game to see it as a splash screen.
01/28/2010 (11:59 pm)
Copy that whole code drop into a text doc. and name it startup1.gui.Place it in "game/client/ui/"
In that same folder, find startup.gui and look twords the bottom.
Find: and change to:
function checkStartupDone()
{
if (StartupGui.done)
{
echo ("*** Load 3Dcentral Splash");
//loadMainMenu(); //comment out for startup1 to work.
loadStartup1();
}
else
schedule(100, 0, checkStartupDone );
}Change the name of the video to your video and save.Enter your game to see it as a splash screen.
#5
02/12/2010 (1:02 am)
What is wrong if the only thing that pops up is a black screen?
#6
03/07/2010 (7:00 pm)
Did you change the filename? :]
Torque Owner frankzhao