Viewport_Mask
Authors: Newold
Version: 1.0
Type: VIEWPORT ADDON
Key Term: Misc Add-on
IntroductionWith this script you can use viewports non-reactangular (Circle viewport for example)
Features
- Create viewports non-rectangular easily
- You can animate bitmap in this viewports as planes (see example in demo)
Screenshots
DemoDemo for XP:
http://www.megaupload.com/?d=C7X9YH09 or
http://www.mediafire.com/?ivda939v8ba5mvyDemo for VX:
http://www.megaupload.com/?d=GMMPHMZR or
http://www.mediafire.com/?zb4ebkcp4asaqzb
Script
InstructionsThe instructions are in spanish in the script, (the script in the demo is called **Masks**) here I put the instruction in english (google translate and superviced by me, but may contain errors in grammar). You can to put this script anywhere in the script's editor in your project
Instructions translate in English
=begin
-------------------------------------------------- ---------------------------
By newold
08/10/2011
-------------------------------------------------- ---------------------------
This script will create viewport for sprites in any way
(circle, triangle, irregular polygon...).
-------------------------------------------------- ---------------------------
Use:
The script load images from folder that will contain viewport-mask.
(Any non-transparent part of these images will be deleted on the image
sprite)
Once you've created your sprite and you've assigned a picture, you can apply
this new viewport like this:
your_sprite.mask = Viewport_Mask.new ("Name of pattern of the viewport")
Automatically, the image of the sprite will be resized to size of the image
pattern, and it will look as form of the pattern.
To move the image on the new viewport, use this command:
your_sprite.ani_mask(Speed X, Speed Y)
the image will move as if it were a plane
******************************************************************************
Tutorial to create pattern in Photoshop:
******************************************************************************
1 - Create a new image.
2 - Draw the desired shape of the viewport with a solid color
(Eg: #000000)
3 - Once created the pattern, you pressed press "Left click" on
the image in the layers palette with "CTRL" pressed, to select your pattern.
4 - Press "delete/Back" to delete the pattern.
5 - Press CTRL + SHIFT + I to invert the selection
6 - Take the paint with a solid color (Eg: #000000)
7 - Fill the selection
8 - Save the pattern as png in the pictures folder of your game
9 - Now you can use this pattern to create a viewport with him.
******************************************************************************
=end
Compatibility100% compatible with XP and VX
Credits and Thanks
- me
Author's NotesI leave to your imagination the use that you could to give to this script in yours proyects... (circle mini-maps perhaps?)
PS: sorry for the grammar and spelling mistakes