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:
shiva404
2026-02-15 21:23:02 +03:00
parent ab58803373
commit f679dde81f
12 changed files with 637 additions and 838 deletions

View File

@@ -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)