• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

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