• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [SOLVED] Draw tiled background on a portion of the screen

Hello everyone, Im trying to make a room that has a black background with a tiled wood background on a portion of the screen. This might be way simpler than Im making it, but Im clueless.
here is my code:
Create:
Code:
MaxX = (room_width*0.8)/background_get_width(bgWood)
MaxY = (room_height*0.8)/background_get_height(bgWood)
MinX = room_width*0.1
MinY = room_height*0.1
Draw:
Code:
total = ((MaxX-MinX)/background_get_width(bgWood))+((MaxY-MinY)/background_get_height(bgWood))
tX = MinX tY = MinY

for(i=1;i<total;i+=1) {
draw_background(bgWood,tX,tY)
tX += background_get_width(bgWood)
if(tX >= MaxX) { tx = MinX tY += background_get_height(bgWood) }
}
if you know what is wrong or you know a better way to do this then please tell me! Thanks!
P.S. I was kinda in a rush when I made this post, so if you need more information or something then please message me =)
 

TheouAegis

Member
MaxX = (room_width*0.8)/background_get_width(bgWood) <==Remove the division
MaxY = (room_height*0.8)/background_get_height(bgWood) <==Remove the division
MinX = room_width*0.1
MinY = room_height*0.1
 
MaxX = (room_width*0.8)/background_get_width(bgWood) <==Remove the division
MaxY = (room_height*0.8)/background_get_height(bgWood) <==Remove the division
MinX = room_width*0.1
MinY = room_height*0.1
Yeah, that was a big problem, but I fixed that and now it is showing the background but it doesn't cover the whole area it should. Once it hits the MaxX it doesn't stop. it makes a line like this:
 
Top