Download
The PostFX library, an example usage .GMK, the PostFX builder, and two example scripts created with the Builder: Download Here
What is PostFX?
PostFX is a script library that allows you to easily apply graphical effects to the entire screen of your game (hence its name: "post" = "after all drawing is done"). It's designed to not only be simple to use, but also modular, so new effects can be created by anyone with GML knowledge and implemented in a single line of code.
There are only 5 core PostFX scripts:
FX_Start() - Call this in your effects controller's Room Start event. No arguments needed. Sets up the surface used by PostFX and gives drawing control to the PostFX system. Must be called in the Room Start event, not anywhere else (since each room may be different sizes).
FX_Prepare() - Call this at the beginning of your controller's End Step event. This prepares the PostFX surface and actually calls all your instances' Draw events (it's for this reason it should only be called ONCE per step).
FX_Apply(effect[, optional arguments]) - This applies whatever effect you specify. An effect is a script (its ID, not a string). Some effects may take optional extra arguments, others may not. Effects are applied in the order you call them, and they stack. For example, I can apply an Invert effect followed by a Hole effect to get a black screen with a cutout that's inverted, or I can apply a Hole effect followed by an Invert effect to get a white screen with an inverted cutout (because in this order, the black from the hole will be inverted as well). Stacking effects gives you a lot of flexibility with your final result.
FX_Draw() - No arguments needed; this actually draws the final, effect-filled render to the screen. Most often, you will only need to call this once after all your effects are applied, but since effects may create areas of transparency, it's possibly you may call this multiple times in some cases.
FX_End() - No arguments; this frees the memory used by PostFX and hands drawing control back to GM. Call this only if you're not using PostFX anymore.
The main library also comes with 3 bundled effects: Invert() [which inverts the screen colors], Hole [which creates a black screen with a fading cutout], and Grayscale [which desaturates the screen, but is VERY slow].

(In the included example demo, press SHIFT, ENTER, and SPACE to toggle the various bundled effects)
PostFX Builder
Since PostFX is designed to be modular, one of its main features is how simple it is to create compatible effects. A PostFX effect is simply a GML script. When the script is called, the drawing target will be set to a surface, and this surface will contain all of the screen's graphical content already pre-composed. In addition, PostFX handles the stacking of effects, so each effect can be treated as isolated, meaning you don't have to worry about which effects, if any, have previously been applied. All your script needs to do is draw.
In case you plan on switching the drawing target during your effect, it may be helpful to know that the PostFX surface is called global.__FXSurf. For example, the Hole effect creates a new surface for the hole, and then switches back to the global.__FXSurf to draw it over the screen.
One method of creating effects is to create a temporary .GMK, load some graphics in, import the PostFX library, and code. That's fine...except every time you need to make an adjustment to your effect, you need to exit the program, open the script, change it, and re-run the program. That's a bit much for one mod. Which is why...
PostFX comes bundled with the PostFX Builder! The PostFX Builder is a complete Integrated Development Environment for creating and testing PostFX effects.

In addition to providing real-time previews of the results of your effect, PostFX Builder also allows you to include metadata about your effect, such as effect title, author, script name (which is how it will be imported into GM), effect description, and information about any extra arguments (i.e. whether it's required or optional, its name, and a description of how it's used). This metadata will be added to a comment block at the front of your script when you save it. In addition, this comment block provides the data when you load a PostFX script into the Builder at a later date. All effects made in the PostFX builder can be saved (as a .GML file that can be imported into GM directly) and loaded later (with all metadata intact).

For detailed information about how to use PostFX Builder, read the help file here: http://dl.dropbox.co...tFX/Readme.html
Download
The PostFX library, an example usage .GMK, the PostFX builder, and two example scripts created with the Builder: Download Here
Credits
The PostFX Builder uses Shadowrend's GM WinAPI GML library for form elements, with some modifications by me (bug fixes and adjustments).
-IMP
Edited by IceMetalPunk, 14 February 2012 - 01:45 AM.











