It's called BGPUT and BGFILL. http://imgur.com/YSCyQJi
I recommend using this chart to refer to a tile's HEX ID instead of using decimal ID for a good reason.
This is how to read the chart: the pawn is 0004, the lava is 007F, and the unopened treasure box is 0360.
BGPUT lets you put one tile at a time. Try this
BGPUT 0,12,7,"0360" 'BGPUT layer,X,Y,"tile hex id"This code puts a treasure box smack-dab in the middle of the top screen, since BG's X ranges from 0 to 24, and Y from 0 to 14 by default. The quotes tell SB that it should check the HEX ID of the tile. Now let's learn BGFILL. We can fill the entire screen with lava. Bowser should like this.
BGFILL 0,0,0,25,15,"0360" 'BGPUT layer,startX,startY,endX,endY,"tile hex id"We can "chain" tiles together like this:
BGFILL 0,0,0,25,15,"032703280329032A032B032C032D032E032F"+"034703480349034A034B034C034D034E034F"Yeah! It's a... weird looking desert! It's because our desert tiles are 9 by 2, and that's not a multiple of 25 by 15. We'll have to get creative and do this:
BGFILL 0,0,0,25,15,"032703280329032A032B032C032D032E032F"*2+"032703280329032A032B032C032D"+ "034703480349034A034B034C034D034E034F"*2+"034703480349034A034B034C034D"Much better. BGFILL will repeat the string if it's not enough. But it can be even better, let's fill the bottom with sandy tile 021F:
BGFILL 0,0,0,25,15,"032703280329032A032B032C032D032E032F"*2+"032703280329032A032B032C032D"+ "034703480349034A034B034C034D034E034F"*2+"034703480349034A034B034C034D"+"021F"*25*13Perfect desert!