Understanding the language, error messages, etc.
by mousam59 » Thu Aug 21, 2014 9:19 am
hello,
i have a question about the sprite.
when you made a sprite, there was 0 or 1 for color... 1 for black and 0 is transparent .... but if i want to made a big sprite with space in it, when it was displayed we could see the background.... then i think about a mask... display the background, so the mask to erase the portion of background where my hero is draw and at last display onto the mask my hero..... how could i make that?????????
for example, i have a old gameboy in B&W, castlevania, the background was plenty of texture, and the hero had a white line around it to clarify the game, this is that sort of technique that i want to make..... but if i made a mask with 1 for white, gb will display a black..... and if i want to the all screen was black and my sprite white?????
i'll expect everybody understand...
thank's
bye.
-
mousam59
-
- Posts: 9
- Joined: Sat Aug 02, 2014 7:30 pm
by rodot » Thu Aug 21, 2014 11:05 am
The default colors for the graphical function are black foreground and transparent background. You can change it using
gb.display.setColor(foreground, background).
In your case you can create a bitmap containing the white outline of your character and then do something like that:
- Code: Select all
gb.display.setColor(WHITE);
gb.display.drawBitmap(characterMask);
gb.display.setColor(BLACK);
gb.display.drawBitmap(characterBitmap);
-
rodot
- Site Admin
-
- Posts: 1290
- Joined: Mon Nov 19, 2012 11:54 pm
- Location: France
-
by mousam59 » Thu Aug 21, 2014 11:18 am
hello,
ok. thank's a lot, there is always a solution for a problem.....
bye.
-
mousam59
-
- Posts: 9
- Joined: Sat Aug 02, 2014 7:30 pm
Return to Programming Questions
Who is online
Users browsing this forum: No registered users and 67 guests