Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: KyriakosCH on Fri 14/08/2020 20:19:23

Title: Can you play a video (eg OGV) in part of the screen?
Post by: KyriakosCH on Fri 14/08/2020 20:19:23
I was thinking of using a video on a tv, in one of the rooms of the game. Can I somehow set the tv area to have the video play there?
Video consists of both sound and images.

I suppose this may not be possible - if not I can always just use an animated object there, and have a separate sound file. But no harm in asking ;)
Title: Re: Can you play a video (eg OGV) in part of the screen?
Post by: Mandle on Sat 15/08/2020 00:21:29
I have done it in a game, but I don't remember how, something to do with draw surfaces I think, and it was very fiddly, but, yes, it can be done.
Title: Re: Can you play a video (eg OGV) in part of the screen?
Post by: KyriakosCH on Sat 15/08/2020 10:56:03
^ Hm.... :)
Title: Re: Can you play a video (eg OGV) in part of the screen?
Post by: morganw on Sat 15/08/2020 11:43:12
I believe that you can do it with this plug-in but it brings some restrictions (Direct3D only) and I've not tried it myself.
PLUGIN: Direct3D v1.0 (Sprite and Theora video rendering) (https://www.adventuregamestudio.co.uk/forums/index.php?topic=45348.0=)
Title: Re: Can you play a video (eg OGV) in part of the screen?
Post by: KyriakosCH on Sat 15/08/2020 12:03:46
Thanks :) I will have a look, though I don't want to risk it not running for some users (is this a possibility?)
Title: Re: Can you play a video (eg OGV) in part of the screen?
Post by: Crimson Wizard on Sat 15/08/2020 14:30:46
Quote from: KyriakosCH on Sat 15/08/2020 12:03:46
though I don't want to risk it not running for some users (is this a possibility?)

It is a possibility, and 100% that won't work anywhere but on Windows.
Also another person mentioned that this plugin has issues with 3.5.0 (wrong scaling or centering or something), you may read the last comments in the thread.
Title: Re: Can you play a video (eg OGV) in part of the screen?
Post by: Vincent on Sat 15/08/2020 14:45:15
With the plugin that morganw mentioned you can resize the video and display on a tv (though the audio that comes out from the video you can't hear it with the plugin, you should play the sound separately in case). Basically this is what you need to run the video with the plugin:

Code (ags) Select

Theora* video;

function room_Load()
{
  video = Theora.Open("Tv.ogg"); //name of the video
}

function repeatedly_execute_always()
{
  if (video != null)
  {
    video.DrawEx(DsBackground, 135., 110., 0., 0., 0., RtScreen); //adjust x and y as you wish
    video.NextFrame();
  }
}


I didn't test it on the new version of Ags but as CW said the plugin will work only for Windows users...

EDIT: Actually I was referring to this plugin (https://www.adventuregamestudio.co.uk/forums/index.php?topic=34910.msg456858;topicseen#msg456858) which is the oldest version.
Title: Re: Can you play a video (eg OGV) in part of the screen?
Post by: KyriakosCH on Sat 15/08/2020 15:40:01
Thank you both!
Certainly interesting, even if end up not using it in this project, I can use it for other ones...