set background color

Understanding the language, error messages, etc.

set background color

Postby noah » Wed Aug 10, 2016 6:34 pm

Is there a way to set a "background color" that appears behind sprites? Currently behind my spitear is white but is there a way to set that to black? I didn't see anything in the reference.
... thanks in advance, noah
User avatar
noah
 
Posts: 25
Joined: Mon Jul 25, 2016 8:32 am
Location: Spiffin' Britain

Re: set background color

Postby Sorunome » Wed Aug 10, 2016 6:46 pm

Actually, it does say in the reference :P http://gamebuino.com/wiki/index.php?tit ... y.setColor

So you do gb.display.setColor(FORGROUND_COLOR,BACKGROUND_COLOR);

e.g.: gb.display.setColor(WHITE,BLACK);
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: set background color

Postby noah » Wed Aug 10, 2016 7:04 pm

Hooow embarrasing :oops:
Thanks :)
User avatar
noah
 
Posts: 25
Joined: Mon Jul 25, 2016 8:32 am
Location: Spiffin' Britain

Re: set background color

Postby noah » Wed Aug 10, 2016 7:18 pm

Actually, I don't think this does what I want it to do. This sets the background color when you draw a circle, square or whatever, but I want the whole of the screen to be black but to have the sprites overlaid. I'm not sure how to make this clearer, but I hope you understand what I'm trying to say.
Thanks, noah
User avatar
noah
 
Posts: 25
Joined: Mon Jul 25, 2016 8:32 am
Location: Spiffin' Britain

Re: set background color

Postby Sorunome » Wed Aug 10, 2016 8:17 pm

Just draw a black rectangle over the entire screen as the first thing to do
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: set background color

Postby Duhjoker » Wed Aug 10, 2016 8:57 pm

if you make your background bitmap colored in black and white on the get go or use the tilemap editor you can design terrain sprites of any color as long as they are black and white and the background color should be what you want. I had a problem with this too in the beginning, all my background sprites were floor colored black so I just saved my sprites using mspaint to kill the transparency and they look good now.

setting color is more for using multiple bitmaps of thr same kind to produce greys
User avatar
Duhjoker
 
Posts: 446
Joined: Sat Jul 02, 2016 4:57 am
Location: Where Palm trees grow


Return to Programming Questions

Who is online

Users browsing this forum: No registered users and 13 guests