Game Development Community

Video File loading

by Colleen Monahan · in Torque Game Builder · 08/17/2005 (2:16 pm) · 1 replies

Hi all,

I am making a game which requires a video be shown upon taking an action (like clicking a GuiButtonCtrl). However, upon clicking the button, T2D stalls (you can't even move the mouse) for a few seconds while showing a black box and then the video finally starts to play. Is this due to T2D 'loading' the video? How can I avoid this behavior?

Right now, I have the button call a command which creates the GuiAviBitmapCtrl.

function playVideo(%videoFileName)
{
   new GuiAviBitmapCtrl(videoHolder) {
      profile = "GuiDefaultProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      aviFileName = %videoFileName;
      position = "236 120";
      extent = "163 210";
      minExtent = "8 2";
      visible = "0";
      swapRB = "1";
      done = "0";
      letterBox = "0";
      speed = "1";
   };
      testgui.add(videoHolder);
}

Putting the GuiAviBitmapCtrl in before runtime actually results in more laggy behavior when the canvas sets content to testGui.

Please advise.

Thanks.

#1
08/22/2005 (9:46 am)
I've fixed the problem. Basically,

Static AviBitmapCtrl + streaming video = slow
Static AviBitmapCtrl + local video file = slow
Dynamic AviBitmapCtrl + streaming video = slow
Dynamic AviBitmapCtrl + local video file = instant!