added all the comments, ALL OF THEM
This commit is contained in:
parent
dca14abe57
commit
b0bafa7503
3 changed files with 60 additions and 61 deletions
12
render.py
12
render.py
|
|
@ -1,7 +1,7 @@
|
|||
import pygame
|
||||
import pygame # imports pygame obviously
|
||||
|
||||
def load_sprite(sheet, x, y, width, height, screen_width, screen_height):
|
||||
rect = pygame.Rect(x, y, width, height)
|
||||
sprite = sheet.subsurface(rect)
|
||||
scaled = pygame.transform.scale(sprite, (screen_width, screen_height))
|
||||
return scaled
|
||||
def load_sprite(sheet, x, y, width, height, screen_width, screen_height): # the function for our sprite rendering function
|
||||
rect = pygame.Rect(x, y, width, height) # this defines our cutout from the sprite sheet its like position; size
|
||||
sprite = sheet.subsurface(rect) # this goes on to cut it from the sheet actually
|
||||
scaled = pygame.transform.scale(sprite, (screen_width, screen_height)) # this scales the cutout to what we want/what we chose
|
||||
return scaled # this returns our cutout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue