Can you play a video (eg OGV) in part of the screen?

Started by KyriakosCH, Fri 14/08/2020 20:19:23

Previous topic - Next topic

KyriakosCH

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 ;)
This is the Way - A dark allegory. My Twitter!  My Youtube!

Mandle

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.


morganw

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)

KyriakosCH

Thanks :) I will have a look, though I don't want to risk it not running for some users (is this a possibility?)
This is the Way - A dark allegory. My Twitter!  My Youtube!

Crimson Wizard

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.

Vincent

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

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 which is the oldest version.

KyriakosCH

Thank you both!
Certainly interesting, even if end up not using it in this project, I can use it for other ones...
This is the Way - A dark allegory. My Twitter!  My Youtube!

SMF spam blocked by CleanTalk