#16744 - darknet - Tue Feb 24, 2004 7:10 am
I know this question has been asked numerous times across the forums, and I have read every answer that I believe is available so here goes:
I want a splash screen for my project. A background along with 2 sprites; 1 for 'Start new game' and the other for 'load new game'
I am in mode 4 and have initalized everything properly. However, no matter what I do I cannot get the sprites to be transparent over the background. Here is a checklist of things I have done:
-Checked the entry at the beginning of all the palettes were black, created a .pcx file with a black background + white text
-Have all the proper dimensions and bits set correctly for both the sprite and the background image.
-Started the sprite at 512 since mode 4 uses 0-511
Any help would be greatly, greatly appreciated. Below is a snipet of my code:
I want a splash screen for my project. A background along with 2 sprites; 1 for 'Start new game' and the other for 'load new game'
I am in mode 4 and have initalized everything properly. However, no matter what I do I cannot get the sprites to be transparent over the background. Here is a checklist of things I have done:
-Checked the entry at the beginning of all the palettes were black, created a .pcx file with a black background + white text
-Have all the proper dimensions and bits set correctly for both the sprite and the background image.
-Started the sprite at 512 since mode 4 uses 0-511
Any help would be greatly, greatly appreciated. Below is a snipet of my code:
Code: |
setMode(OBJ_MAP_1D | MODE_4 | OBJ_ENABLE | BG2_ENABLE); //Load the sprites palette int loop = 0; for(loop = 0; loop<256; loop++) { SpritePal[loop] = startNewPalette[loop]; } initalizeSprites(); unsigned char attrs = 0; //0 is the first set of attrs sprites[attrs].attr0 = COLOR_256 | TALL | y; sprites[attrs].attr1 = SIZE_64 | x;; sprites[attrs].attr2 = 512; //now that its setup, copy the sprite data to char memory int x_loop = 0; //now copy in the sprites bitmap. for(x_loop = 8192; x_loop < 8320; x_loop++) { SpriteData[x_loop] = startNewData[x_loop-8192]; } for(int n = 0; n<256; n++) { BGPaletteMem[n] = splash_Palette[n]; } memcpy(videoBuffer, splash_Bitmap, 38400); while(1) { getInput(); moveSprite(&sprites[0], x,y); waitVSync(); updateSpriteMemory(); } return 0; } |