Thread:Randomouscrap98/@comment-24568832-20140217005924/@comment-9531161-20140217024210

OK, there's a lot of stuff wrong with this. Let's start with the BG:

You usually use BGPUT to put stuff on the BG right? It looks something like: BGPUT 0,X,Y,THETILE,THEPALETTE,0,0

0 is the layer, and X / Y specify the BG location for the tile, right? Each tile is 8X8, so X goes from 0 to 31 to fill the screen, and Y goes from 0 to 23 (to fill the screen). THETILE is whatever tile you wanted to put on the BG, and THEPALETTE is just the color scheme. Hopefully this makes sense; it's kind of like doing PNLSTR and printing one character at a time. If you are putting BGs on the screen from an array, it would look something like this: DIM MYCAFE(32,24) RESTORE @MYCAFEDATA 'Fill MYCAFE with data here 'Now draw the BG using the data in the array FOR X=0 TO 31 FOR Y=0 TO 23 BGPUT 0,X,Y,MYCAFE(X,Y),THEPALETTE,0,0 NEXT NEXT

And that's that. Hopefully that part all makes sense. Now GPUTCHR does nearly the same thing, but its X and Y coordinates are by pixel, not by tile grid. In this case, the above loop would look like this for GPUTCHR: FOR X=0 TO 31 FOR Y=0 TO 23 GPUTCHR X*8,Y*8,"BGU0",MYCAFE(X,Y),THEPALETTE,1 NEXT NEXT

The BGU0 specifies which sprite sheet contains the character which represents MYCAFE(X,Y). It DOES NOT look at the current BG and retrieve the tile from there; it simply draws a tile just like BGPUT does. This means that this loop will only allow you to use tiles that are stored on the first BG sheet. This can be changed, but this is just a simple example. Notice that X and Y are multiplied by 8: this is because the tiles are 8X8, so we want to place them in the right place.

If something still isn't clear about GPUTCHR, let me know.