How to use the object mask plugin (h2): Difference between revisions

From The Official Visionaire Studio: Adventure Game Engine Wiki
No edit summary
No edit summary
Line 6: Line 6:
|}
|}


This tutorial will show you how you can use the mask plugin for Visionaire Studio. Masking is process that involves using one image to mask another image, but what exactly is a mask? A mask determines which parts of image you want to mask will be drawn or hidden. Here is a quick example of an image, a mask & the end result.  
This tutorial will show you how you can use the mask plugin for Visionaire Studio. Masking is process that involves using one image to mask another image, but what exactly is a mask? A mask determines which parts of the masked image/animation will be drawn in or hidden. Here is a quick example of an image, a mask & the end result.  


[[File:Mask_plugin_mask_explanation.png|800px]]
[[File:Mask_plugin_mask_explanation.png|800px]]
Line 19: Line 19:
[[File:Mask_plugin_(02).png|800px]]
[[File:Mask_plugin_(02).png|800px]]


Now that you have an image you want to mask, you will need to create an image to use as a mask. Your mask image should comprise of white & alpha transparency. Only the parts of the masked image that overlap white parts in the mask image will be drawn in.
Now that you have an image you want to mask, you will need to create an image to use as a mask. Your mask image should comprise of white & alpha transparency. Only the parts of the masked image that overlap the white parts of the mask image will be drawn in.


[[File:Mask_plugin_(03).png|800px]]
[[File:Mask_plugin_(03).png|800px]]


<html><img src="https://wiki.visionaire-tracker.net/images/a/a8/Pendulum_tutorial_(step_1).gif" width="100%"/></html>


Next you need to select the first frame & then click on the edit button to open up the properties tab & then you need to click on the edit icon ( [[File:anim_editframe.png|16px|link=]] ), then you need to click on the create actions icon ( [[File:choose_action.png|16px|link=]] ) & then you need to create an '''execute a script''' action, which should contain something along the lines of this...
<syntaxhighlight lang="lua">
ActiveAnimations["animation_name"].PlayOppositeDirection = false -- play animation forwards
</syntaxhighlight>
<html><img src="https://wiki.visionaire-tracker.net/images/a/a8/Pendulum_tutorial_(step_2).gif" width="100%"/></html>
& now you need to do the same again for the last frame of the animation except the code you add should look something along the lines of...
<syntaxhighlight lang="lua">
ActiveAnimations["animation_name"].PlayOppositeDirection = true -- play animation in reverse
</syntaxhighlight>
{| class="ts"
|-
| ''Quick note: "animation_name" should be replaced with the actual name of the animation & remember the animation name is case sensitive.''
|}
[[File:pendulum_tutorial_(step_3).png|800px]]


== Reference Video ==
== Reference Video ==

Revision as of 15:59, 4 October 2018

Name By
How to use the object mask plugin (image, action parts) AFRLme

This tutorial will show you how you can use the mask plugin for Visionaire Studio. Masking is process that involves using one image to mask another image, but what exactly is a mask? A mask determines which parts of the masked image/animation will be drawn in or hidden. Here is a quick example of an image, a mask & the end result.

Tutorial

First things first, you will need to add the plugin to your game project. To do this, you will need to click on the plugin button.
Next click on the install button & wait for it to install. Once it's done, you should have access to 2 new action parts, but we will talk more about those later on.

Next you should create & import an image or animation that you want to mask.

Now that you have an image you want to mask, you will need to create an image to use as a mask. Your mask image should comprise of white & alpha transparency. Only the parts of the masked image that overlap the white parts of the mask image will be drawn in.


Reference Video

Resources

Name Description
pendulum_animation.zip A working .ved file, complete with resources. Check out the readme.txt file for instructions.