Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / How to use the video commands

Author
Message
TGC_User
8
Years of Service
User Offline
Joined: 3rd Feb 2016
Location:
Posted: 3rd Feb 2016 19:11
So i got AGK2 a while ago in the humble bundle and just started using it.
I never have used AGK2 or any previous versions of this software.
I have alot of experience coding in gamemaker studio so i know some stuff.
I wanted to create something simple in AGK2 a video player.
It just needs to load a .mp4 of .avi file and play the video.
I looked here:
http://www.appgamekit.com/documentation/Reference/Video.htm
But this only gives me a line of code. I have searched everywhere on the internet youtube forums..
But i can't find a single tutorial explaning how the video commands work.
Could someone create a simple example script where it loads a video file and plays it.
So i have somewhere to start. If the script could be commented that would be very helpfull.
Thanks for your time reading this!
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Feb 2016 20:09
Welcome
There's a sample video app in the examples. For me, it is located here...

C:\Users\<USERNAME>\AppData\Local\AGK Projects\Video\VideoPlayback
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
TGC_User
8
Years of Service
User Offline
Joined: 3rd Feb 2016
Location:
Posted: 3rd Feb 2016 21:22
Thank you! i found it and got it to work. I use the steam version of AGK2 so for me it was located here:
C:\Program Files (x86)\Steam\steamapps\common\App Game Kit 2\Projects\Video\VideoPlayback
Is it possible to select a video file outside of the executable folder location, for example C:\test\video.mp4 when the application is located in C:\Apps\Testapp.exe
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Feb 2016 21:51
On Windows and Mac (and possibly Linux) you can using setRawWritePath(). this also sets the read path.
On Android and iOS this is not allowed for security reasons (AGK would have to include more permissions which it currently doesn't have).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
TGC_User
8
Years of Service
User Offline
Joined: 3rd Feb 2016
Location:
Posted: 3rd Feb 2016 22:38
So i have searched around a bit and don't understand how SetRawWritePath() works.

Here is a piece of my script:

I get this error:
main.agc:22: error: Cannot call "setrawwritepath" here, it does not return a value

How can i load the path from a string?

Also another question when i want to get this " i instead get this ¨ this happens only in AppGameKit any idea how i can turn this off?
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Feb 2016 08:44
SetRawWritePath doesn't return a value, you need...

SetRawWritePath("C:\test\")

After this, all paths are relative to this one.

LoadVideo("video.mp4")

I saw somebody else with the quotes issue, bt I don't know the answer. What language is your keyboard set to?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
TGC_User
8
Years of Service
User Offline
Joined: 3rd Feb 2016
Location:
Posted: 4th Feb 2016 09:52 Edited at: 4th Feb 2016 10:43
Thanks! also i needed LoadVideo("/video.mp4") with an / else it wouldn't work

My keyboard layout is set to United states international
Picture:


Also does someone have an idea how i can draw a line or text on top of the playing video?
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Feb 2016 10:46
But you are using Dutch in Windows? Maybe the IDE can't handle the US keyboard and Dutch language.
I have all sorts of issues like this when I connect to Remote Desktop on international clients. One of them uses Dutch-Belgian, and it completely messes with my UK keyboard!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
TGC_User
8
Years of Service
User Offline
Joined: 3rd Feb 2016
Location:
Posted: 4th Feb 2016 11:03 Edited at: 4th Feb 2016 11:53
Yes my windows is set to dutch and the keyboard US, i have also tried other keyboards: Dutch UK (international basic advanced) US (International).
But it gives me ¨ or ~ instead of " any way to fix this problem?

I am also having trouble changing the depth of text to draw text on top of the video.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 4th Feb 2016 12:03
Currently we cannot draw on top of video in AGK. The video player uses a completely seperate surface to the OpenGL view used by AGK. Paul mentioned he may investigate this further for a future release. See: https://forum.thegamecreators.com/thread/216258
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
TGC_User
8
Years of Service
User Offline
Joined: 3rd Feb 2016
Location:
Posted: 4th Feb 2016 12:51
Thanks i vote for this hopefully it will get released soon.
TGC_User
8
Years of Service
User Offline
Joined: 3rd Feb 2016
Location:
Posted: 4th Feb 2016 20:25 Edited at: 4th Feb 2016 21:35
Also is there a way to start the video at a certain time?
And can you set the focus to the application because when a video is playing it looses it focus and i can only focus it again if i click the title bar on top.

Login to post a reply

Server time is: 2024-03-28 11:11:54
Your offset time is: 2024-03-28 11:11:54