gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Tile scroller problem

#83150 - Valmond - Sat May 13, 2006 11:52 am

Hi !

I'v spent some days going through the DS part of the forum and
lernt quite a lot (yep, I'm a noob to DS programming).
I'v also gone through some tutorials and a lot of raw data
found on a lot of sites...

So I have (finally :p) a text/tile background up and
running, tileset, palette and mapdata loaded, youpi !

I'v just got two (minor I hope) problems :-)

The first is just that there are no transparent pixels...
do you need to set this somewhere(I bet you do) or shouldn't

it be colorindex 0 in the palette or ... well how do you decide
which colorindex should be transparent on a text/tile bg ?


The second problem is different; I would like to use the text/tile
background to make a scroller.

Thought that I should scroll sub-tile sized lengths (0..7) with the
registers (BG0_X0 and BG0_Y0 etc) and move the mapdata
for the rest.

Example :
Scroller is in position 0
Moving to the right is just loading BG0_X0 with 1,2,3....7
then move the mapdata itself one step to the right and restart BG0_X0
with 0,1,2....7 etc. (between VBlanks offcourse)

This however creates artefacts on the sides as the map is
exactly the same size as the screen (32 tiles width) :
([Images not permitted - Click here to view it])
At the left some pixels actually comes from the tiles on the right
side of the screen/map.

So my question is; can you make a(slightly) bigger map
or is text/tile mode just for static backgrounds ?


Cheers & thanks !

/Valmond

#83153 - tepples - Sat May 13, 2006 1:58 pm

Valmond wrote:
The first is just that there are no transparent pixels...
do you need to set this somewhere(I bet you do) or shouldn't

it be colorindex 0 in the palette or ... well how do you decide
which colorindex should be transparent on a text/tile bg ?

It's always color index 0.

Quote:
[Scrolling horizontally on a 32x32 tile map] however creates artefacts on the sides as the map is
exactly the same size as the screen (32 tiles width) :
([Images not permitted - Click here to view it])
At the left some pixels actually comes from the tiles on the right
side of the screen/map.

So my question is; can you make a(slightly) bigger map
or is text/tile mode just for static backgrounds ?

You need to use a 64x32 tile map, or you need to use Kirby Super Star's solution of using windows to cut off 4 pixels from each side.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#83155 - Valmond - Sat May 13, 2006 2:12 pm

Funny you always find what you'r searching for when you ask someone else for it :-)

I just found a tile-example with a "BG_32x32" in the reg-setup (I didn't
have anything like it) so I tried a BG_64x32 and the define actually
exists and it works !

So I dont need to use 'borders' or invisibilying windows but thanks for the tip !


For the transparent pixels, I still cant get it to work though...
for examle, after le palette setup & load, if I do this :
BG_PALETTE[0]=RGB15(15,7,0);
the pixels "nr zero" all gets a cozy brown color...

Well, I'm not having more than one background moving around, but
it should'nt be brown right ?


And thanks for the time and the help !

/Valmond

#83165 - tepples - Sat May 13, 2006 4:22 pm

If all layers are transparent at a given point, then the background will be brown (or whatever other color you have set as bg color 0).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#83168 - Valmond - Sat May 13, 2006 5:13 pm

I see, so it will actually be impossible to "see" the
transparency with only one background !

Thanks again !

/Valmond

#83171 - tepples - Sat May 13, 2006 5:48 pm

On the NES, Game Boy, Super NES, GBC, GBA, or Nintendo DS, the only way to see background transparency with one background is to put sprites behind that background.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.