Adding Sign Language Videos [GameMaker]
Last year, I was super excited to learn that GameMaker had added video playback. With this new update, I could finally start creating "Mixcommunication" a game concept I drafted back in 2018!
Mixcommunication is a game about two children who become friends even though they don't communicate using the same language. As part of the game, I wanted to include Japanese Sign Language and British Sign Language video interpretations for the two main characters in the game. For anyone who might be interested in adding videos to their games, you can use the sample code below to get you started.
What the code does:
This code will make a video that plays once and then disappears. When you press the space bar, the next video in the array will start playing.
If you want to see an example of this in action, check out the video below.
Add videos to your game:
You’ll have to add the videos you want to use to your included files by dragging and dropping them. A pop-up will appear asking you if you want to add the video(s) to your included files. Later when writing the names of your videos in your array, make sure to write the name exactly as it is written in the included files, including the .mp4 or equivalent.
The Code:
In the create event:
page = 0;
playvideo= true;
signing[0] = "Video One.mp4"; //Replace with the name of your first video
signing[1] = "Video Two.mp4" //Replace with the name of your second video
signing[2] = "Video Three.mp4" //Replace with the name of your third video
page_number = array_length(signing)
video = video_open(signing[page]);
video_enable_loop(false);
In the draw event:
if page == 0 {
var _videoData = video_draw();
var _videoStatus = _videoData[0];
if (_videoStatus == 0)
{
draw_surface(_videoData[1], 575, 100);
}
if (keyboard_check_pressed(vk_space)) {
var _Status = video_get_status();
if (_Status == video_status_playing)
{
video_close();
}
playvideo = false;
if page < page_number - 1 {
page+=1;
}
}
}
else if page == 1 {
if playvideo = false {
if (video_get_status() == video_status_closed){
video = video_open(signing[page]);
alarm[0] = 10;
}
}
var _videoData = video_draw();
var _videoStatus = _videoData[0];
if (_videoStatus == 0)
{
draw_surface(_videoData[1], 575, 100);
}
if (keyboard_check_pressed(vk_space)) {
var _Status = video_get_status();
if (_Status == video_status_playing)
{
video_close();
}
playvideo = false;
if page < page_number - 1 {
page+=1;
}
}
}
else if page == 2 {
if playvideo = false {
if (video_get_status() == video_status_closed){
video = video_open(signing[page]);
alarm[0] = 10;
}
}
var _videoData = video_draw();
var _videoStatus = _videoData[0];
if (_videoStatus == 0)
{
draw_surface(_videoData[1], 575, 100);
}
if (keyboard_check_pressed(vk_space)) {
var _Status = video_get_status();
if (_Status == video_status_playing)
{
video_close();
}
playvideo = false;
//As there are no more videos in the array, set page to a random high number outside of the array size.
page = array_length(signing) + 100;
}
}
In Alarm [0]:
playvideo = true;
I’m not the best programmer, so there will probably be more efficient ways to get the code working. But I hope that this post is helpful for anyone wanting to include sign language videos or other types of videos in their games.
Special thanks:
To Manae Makino for doing the Japanese Sign Language videos for Shio in this game and Kiriko Okuda for voicing Shio.
Get Mixcommunication
Mixcommunication
Through the power of friendship (and cute doodles) overcome all language barriers!
Status | In development |
Author | Willow Flame |
Genre | Visual Novel |
Tags | language-learning, sign-language |
Languages | English |
More posts
- Mixcommunication Demo - Now Available!Jan 20, 2024
Leave a comment
Log in with itch.io to leave a comment.