can fill sub-rect of a surface with tile
This commit is contained in:
parent
ebe0bad311
commit
4f25a971d7
|
@ -214,9 +214,11 @@ def get_inverted_surface(base):
|
|||
del pixels
|
||||
return surface
|
||||
|
||||
def fill_tile(surface, tile):
|
||||
for x in range(0, surface.get_width(), tile.get_width()):
|
||||
for y in range(0, surface.get_height(), tile.get_height()):
|
||||
def fill_tile(surface, tile, rect=None):
|
||||
w, h = tile.get_size()
|
||||
surface.set_clip(rect)
|
||||
for x in range(0, surface.get_width(), w):
|
||||
for y in range(0, surface.get_height(), h):
|
||||
surface.blit(tile, (x, y))
|
||||
|
||||
def get_shadowed_text(text, font, offset, color, antialias=True, shadow_color=(0, 0, 0),
|
||||
|
|
Loading…
Reference in New Issue