#23110 - Rommel - Sun Jul 04, 2004 11:02 pm
Edit: Forgot to explain problem ^^
What I'm trying to do is set up a background on the top fifth of the screen, and the main background is supposed to cover the rest. I went with making pink my transparent color and in the top most background used that where I want to see the other background. Then I write in the top one, then the second. Setting the top one with the higher priority then the second so the second should just show through the transparent colors, however this doesn't end up happening. Depending on how I write in the backgrounds (order) I'll either see the top portion flash then the later one will take the whole screen (ignoring priorities it seems) or if I write the top last it will indeed show up but the transparent color is all black instead of showing the other background. I've looked through the faq, and have searched through the posts here for the last hour or so for simular problems, but none have had the answer I'm looking for. Anyways, here's the code I'm using, thanks for any help.
SetMode(MODE_1 | OBJ_ENABLE | OBJ_MAP_1D);
bg2.number = 1;
bg2.bg_priority = 3;
bg2.charBaseBlock = 0;
bg2.screenBaseBlock = 28;
bg2.colorMode = BG_COLOR_256;
bg2.size = TEXTBG_SIZE_512x512;
bg2.mosiac = 0;
bg2.x_scroll = 0;
bg2.y_scroll = 0;
EnableBackground(&bg2);
bg1.number = 2;
bg1.bg_priority = 1;
bg1.charBaseBlock = 0;
bg1.screenBaseBlock = 28;
bg1.colorMode = BG_COLOR_256;
bg1.size = ROTBG_SIZE_512x512;
bg1.mosiac = 0;
bg1.x_scroll = 0;
bg1.y_scroll = 0;
EnableBackground(&bg1);
for(loop = 0; loop < 256; loop++)
BGPaletteMem[loop] =topmenutilespal[loop];
for(loop = 0; loop < topmenutiles_WIDTH * topmenutiles_HEIGHT /2; loop++)
bg1.tileData[loop] =topmenutilesdata[loop];
temp = (u16*)topmenu;
for(loop = 0; loop < 64*64/2; loop++)
bg1.mapData[loop] = temp[loop];
for(loop = 0; loop < tiles_WIDTH * tiles_HEIGHT /2; loop++)
bg2.tileData[loop] =tilesData[loop];
temp = (u16*)level1;
for(loop = 0; loop < 64*64/2; loop++)
bg2.mapData[loop] = temp[loop];
What I'm trying to do is set up a background on the top fifth of the screen, and the main background is supposed to cover the rest. I went with making pink my transparent color and in the top most background used that where I want to see the other background. Then I write in the top one, then the second. Setting the top one with the higher priority then the second so the second should just show through the transparent colors, however this doesn't end up happening. Depending on how I write in the backgrounds (order) I'll either see the top portion flash then the later one will take the whole screen (ignoring priorities it seems) or if I write the top last it will indeed show up but the transparent color is all black instead of showing the other background. I've looked through the faq, and have searched through the posts here for the last hour or so for simular problems, but none have had the answer I'm looking for. Anyways, here's the code I'm using, thanks for any help.
SetMode(MODE_1 | OBJ_ENABLE | OBJ_MAP_1D);
bg2.number = 1;
bg2.bg_priority = 3;
bg2.charBaseBlock = 0;
bg2.screenBaseBlock = 28;
bg2.colorMode = BG_COLOR_256;
bg2.size = TEXTBG_SIZE_512x512;
bg2.mosiac = 0;
bg2.x_scroll = 0;
bg2.y_scroll = 0;
EnableBackground(&bg2);
bg1.number = 2;
bg1.bg_priority = 1;
bg1.charBaseBlock = 0;
bg1.screenBaseBlock = 28;
bg1.colorMode = BG_COLOR_256;
bg1.size = ROTBG_SIZE_512x512;
bg1.mosiac = 0;
bg1.x_scroll = 0;
bg1.y_scroll = 0;
EnableBackground(&bg1);
for(loop = 0; loop < 256; loop++)
BGPaletteMem[loop] =topmenutilespal[loop];
for(loop = 0; loop < topmenutiles_WIDTH * topmenutiles_HEIGHT /2; loop++)
bg1.tileData[loop] =topmenutilesdata[loop];
temp = (u16*)topmenu;
for(loop = 0; loop < 64*64/2; loop++)
bg1.mapData[loop] = temp[loop];
for(loop = 0; loop < tiles_WIDTH * tiles_HEIGHT /2; loop++)
bg2.tileData[loop] =tilesData[loop];
temp = (u16*)level1;
for(loop = 0; loop < 64*64/2; loop++)
bg2.mapData[loop] = temp[loop];