Flashing Invert

Understanding the language, error messages, etc.

Flashing Invert

Postby NicK » Fri Mar 13, 2015 12:17 am

I had an idea to create a graphics effect that it rapid color inverting of the screen from white to black to white a few times. Any ideas how this could be implemented? Is there an easy was to grab the screen buffer and modify it etc?
NicK
 
Posts: 27
Joined: Tue Dec 23, 2014 11:25 pm

Re: Flashing Invert

Postby Myndale » Fri Mar 13, 2015 12:28 am

The latest beta version of the library has INVERT as one of the colors, I'm not 100% certain but I don't think it's made it into the main branch yet?

Alternatively, if you prefer to twiddle the back-buffer manually you can get a pointer to it by calling gb.display.getBuffer().
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Flashing Invert

Postby rodot » Fri Mar 13, 2015 6:55 am

Myndale is right, the new INVERT color is still only in the beta branch.
One fast and easy way would be to use gb.display.fillScreen() in my opinion. This function uses memset so it's almost instant compared to gb.display.fillRect.
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: Flashing Invert

Postby NicK » Fri Mar 13, 2015 2:00 pm

thanks. The kind of effect I'm trying to get is to invert the entire screen at that instant - including all background and bitmaps/sprites - and then cycle this a few times. This would just be an effect if you die in a game for example.
NicK
 
Posts: 27
Joined: Tue Dec 23, 2014 11:25 pm


Return to Programming Questions

Who is online

Users browsing this forum: No registered users and 14 guests

cron