P.S. to previous commit: instead of Sprite flow load_sprites function was changed: gathering the number of sprites with the same names before second _ and hold it at sprites dict. also now sprites must be named as objectname_action_number. Main commit - full sprites support, with caching, transparency and smooth scaling. drawing function moved to Object methods
This commit is contained in:
@@ -3,4 +3,10 @@ import json
|
||||
import uuid
|
||||
from dataclasses import dataclass, field
|
||||
from copy import deepcopy
|
||||
import pygame
|
||||
import pygame
|
||||
|
||||
|
||||
def scale_image(image, n):
|
||||
orig_size = image.get_size()
|
||||
new_size = (int(orig_size[0] * n), int(orig_size[1] * n))
|
||||
return pygame.transform.smoothscale(image, new_size)
|
||||
Reference in New Issue
Block a user