Feature: Change Opacity

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

This script provides a “change opacity” feature to your feature objects. When the feature is applied, the opacity of a sprite is changed.

feature_change_opacity

Download

Script: download here
Required: Feature Manager

Installation

  1. Open the script editor
  2. Place this script below Feature Manager and above Main

Usage

Note-tag feature objects with

<feature: change_opacity>
formula: YOUR_FORMULA
</feature>

where YOUR_FORMULA evaluates to an integer.
If the opacity is, then the sprite is invisible, while 255 is fully opaque.

The following variables are available for your formula

  a - the current subject
opc - the subject's current opacity

Note that you cannot have spaces in your formula if your are using the simple note-tag

Examples

Straight numbers

<feature: change_opacity>
formula: 128
</feature>

Base it as a fraction of the subject’s HP

<feature: change_opacity>
formula: a.hp / a.mhp.to_f
</feature>

Use the current opacity value

<feature: change_opacity>
formula: opc - 1
</feature>
Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

6 Responses

  1. AngryAragami says:

    Is it possible to apply this on enemies with script calls? For example, using this in a common event to replicate the blink that enemies perform when they take damage?

  2. Ctelin Ajira says:

    Me: starts testing my game
    Game: "Warning: 'change_opacity' feature requires version 2.00 of this script"

    What's out of date on my end?

    • Hime says:

      That usually means there's a newer version of Feature Manager, and it may require some things that are only available in the new version.

      Just grab the latest one and see if the warning goes away.

  3. Matthew says:

    i was wondering, does this work with states?

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax