|
@@ -14,6 +14,7 @@ from synergine2.config import Config
|
14
|
14
|
from synergine2.simulation import Subject
|
15
|
15
|
from synergine2_cocos2d.animation import AnimatedInterface
|
16
|
16
|
from synergine2_cocos2d.util import PathManager
|
|
17
|
+from synergine2_xyz.image import ImageCacheManager
|
17
|
18
|
|
18
|
19
|
|
19
|
20
|
class Actor(AnimatedInterface, cocos.sprite.Sprite):
|
|
@@ -62,6 +63,13 @@ class Actor(AnimatedInterface, cocos.sprite.Sprite):
|
62
|
63
|
self.properties = properties or {}
|
63
|
64
|
self._freeze = False
|
64
|
65
|
|
|
66
|
+ self.default_image_path = image_path
|
|
67
|
+ self.image_cache = self.get_image_cache_manager()
|
|
68
|
+ self.image_cache.build()
|
|
69
|
+
|
|
70
|
+ def get_image_cache_manager(self) -> ImageCacheManager:
|
|
71
|
+ return ImageCacheManager(self, self.config)
|
|
72
|
+
|
65
|
73
|
def build_default_image(self, subject_id: int, base_image_path: str) -> str:
|
66
|
74
|
cache_dir = self.config.resolve('global.cache_dir_path')
|
67
|
75
|
with open(base_image_path, 'rb') as base_image_file:
|