Making everything black and white

Got a question? Need help? Post here!

Making everything black and white

Postby Schulles » Fri Jan 03, 2014 3:21 pm

Hello there!

I used to do the following in flixel to make everything turn black and white for a few seconds:

Code: Select all
      if (blackAndWhite > 0)
         {
      
         blackAndWhite--;
      
         FlxG.camera.buffer.clone();
         FlxG.camera.buffer.applyFilter(FlxG.camera.buffer,  FlxG.camera.buffer.rect, new Point(), new ColorMatrixFilter([rc, gc, bc, 0, 0, rc, gc, bc, 0, 0, rc, gc, bc, 0, 0, 0, 0, 0, 1, 0]));
         return;
         }
         if (blackAndWhite != -1)
         {
         endThunder();
       }


Can I do something like that in Axel aswell?
Schulles
Private
 
Posts: 9
Joined: Sun Jul 07, 2013 6:12 pm

Re: Making everything black and white

Postby Arkeus » Fri Jan 03, 2014 6:01 pm

I can't think of an easy way to do this at the moment.

The idea is to eventually have post processing effects. So you could write (or there'd be a premade one) a shader that would do this that you could switch on and off (and you could have tons of other effects, such as an underwater effect, or blur, etc). Unfortunately this isn't currently supported.

Outside of modifying shaders I can't think of any way. For AxSprite you could create a new shader that is the same as the current one but does whatever is necessary to normalize the colors to black and white, and swap the shader for all axsprites whenever you set some static black and white variable. But you'd also have to do it for things like AxTilemap and any other things you might be using for drawing.

In short: Will be easy in the future, not easy at the moment.
Image
User avatar
Arkeus
Site Admin
 
Posts: 363
Joined: Mon Mar 26, 2012 12:43 am

Re: Making everything black and white

Postby Schulles » Sun Jan 05, 2014 8:15 am

Alright. Thanks anyways! :) I might just want to skip that for now.
Schulles
Private
 
Posts: 9
Joined: Sun Jul 07, 2013 6:12 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron