S
Shadowblitz16
Guest
does anybody know how to make a function that draw a part of a background but draws wrapped around tiles if the width or size surpasses the actual image bounds?
for example say I had a full background image that I was representing as tiles
lets say its a 4x4 background and each tile is 2x2
background_image
A 0, 1, 2, 3 < X Axis
0 [0, 1, 2, 3],
1 [4, 5, 6, 7],
2 [8, 9, A, B],
3 [C,D, E, F]
^
Y Axis
background_draw_part(background_image, 2, 0, 2, 2, x, y)
A 0, 1, 2, 3 < X Axis
0 [2, 3],
1 [6, 7]
2
3
^
Y Axis
but if I do something like this
I want to be able to return the image like its a 1d array or list of tiles
like so..
background_draw_part(background_image, 3, 0, 2, 2, x, y)
A 0, 1, 2, 3 < X Axis
0 [3, 4],
1 [7, 8],
2
3
^
Y Axis
it would be nice to have this for the y axis too so something like
background_draw_part(background_image, 3, 3, 2, 2, x, y)
A 0, 1, 2, 3 < X Axis
0 [F, 4],
1 [1, 0],
2
3
^
Y Axis
for example say I had a full background image that I was representing as tiles
lets say its a 4x4 background and each tile is 2x2
background_image
A 0, 1, 2, 3 < X Axis
0 [0, 1, 2, 3],
1 [4, 5, 6, 7],
2 [8, 9, A, B],
3 [C,D, E, F]
^
Y Axis
background_draw_part(background_image, 2, 0, 2, 2, x, y)
A 0, 1, 2, 3 < X Axis
0 [2, 3],
1 [6, 7]
2
3
^
Y Axis
but if I do something like this
I want to be able to return the image like its a 1d array or list of tiles
like so..
background_draw_part(background_image, 3, 0, 2, 2, x, y)
A 0, 1, 2, 3 < X Axis
0 [3, 4],
1 [7, 8],
2
3
^
Y Axis
it would be nice to have this for the y axis too so something like
background_draw_part(background_image, 3, 3, 2, 2, x, y)
A 0, 1, 2, 3 < X Axis
0 [F, 4],
1 [1, 0],
2
3
^
Y Axis