batframework 1.0.8a3__py3-none-any.whl → 1.0.8a4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- batFramework/__init__.py +1 -1
- batFramework/animatedSprite.py +49 -55
- batFramework/audioManager.py +2 -2
- batFramework/cutscene.py +5 -2
- batFramework/cutsceneBlocks.py +3 -5
- batFramework/dynamicEntity.py +10 -4
- batFramework/gui/clickableWidget.py +4 -2
- batFramework/gui/constraints/constraints.py +158 -18
- batFramework/gui/interactiveWidget.py +1 -1
- batFramework/gui/label.py +24 -20
- batFramework/gui/root.py +7 -1
- batFramework/gui/shape.py +21 -15
- batFramework/gui/slider.py +17 -33
- batFramework/gui/textInput.py +1 -1
- batFramework/gui/toggle.py +22 -34
- batFramework/gui/widget.py +3 -3
- batFramework/particle.py +4 -4
- batFramework/resourceManager.py +18 -2
- batFramework/scene.py +49 -19
- batFramework/sceneManager.py +9 -14
- batFramework/scrollingSprite.py +7 -8
- batFramework/time.py +32 -27
- batFramework/transition.py +23 -10
- batFramework/utils.py +63 -2
- {batframework-1.0.8a3.dist-info → batframework-1.0.8a4.dist-info}/METADATA +1 -1
- {batframework-1.0.8a3.dist-info → batframework-1.0.8a4.dist-info}/RECORD +29 -29
- {batframework-1.0.8a3.dist-info → batframework-1.0.8a4.dist-info}/LICENCE +0 -0
- {batframework-1.0.8a3.dist-info → batframework-1.0.8a4.dist-info}/WHEEL +0 -0
- {batframework-1.0.8a3.dist-info → batframework-1.0.8a4.dist-info}/top_level.txt +0 -0
batFramework/scene.py
CHANGED
@@ -27,6 +27,7 @@ class Scene:
|
|
27
27
|
"""
|
28
28
|
self.scene_index = 0
|
29
29
|
self.name = name
|
30
|
+
bf.TimeManager().add_register(self.name,False)
|
30
31
|
self.manager: Manager | None = None
|
31
32
|
self.active = False
|
32
33
|
self.visible = False
|
@@ -36,10 +37,16 @@ class Scene:
|
|
36
37
|
self.early_actions: bf.ActionContainer = bf.ActionContainer()
|
37
38
|
self.camera: bf.Camera = bf.Camera(convert_alpha=world_convert_alpha)
|
38
39
|
self.hud_camera: bf.Camera = bf.Camera(convert_alpha=hud_convert_alpha)
|
39
|
-
|
40
|
+
self.should_sort :bool = True
|
40
41
|
self.root: bf.Root = bf.Root(self.hud_camera)
|
41
42
|
self.root.rect.center = self.hud_camera.get_center()
|
42
43
|
self.add_hud_entity(self.root)
|
44
|
+
self.entities_to_remove = []
|
45
|
+
self.entities_to_add = []
|
46
|
+
|
47
|
+
|
48
|
+
def __str__(self)->str:
|
49
|
+
return f"Scene({self.name})"
|
43
50
|
|
44
51
|
def get_world_entity_count(self) -> int:
|
45
52
|
return len(self.world_entities)
|
@@ -130,31 +137,33 @@ class Scene:
|
|
130
137
|
|
131
138
|
def add_world_entity(self, *entities: bf.Entity):
|
132
139
|
"""Add world entities to the scene."""
|
140
|
+
change = False
|
133
141
|
for e in entities:
|
134
|
-
if e not in self.world_entities:
|
135
|
-
|
136
|
-
e
|
137
|
-
|
138
|
-
|
139
|
-
|
142
|
+
if e not in self.world_entities and e not in self.entities_to_add:
|
143
|
+
change = True
|
144
|
+
# self.world_entities[e] = None
|
145
|
+
self.entities_to_add.append(e)
|
146
|
+
e.set_parent_scene(self)
|
147
|
+
# self.sort_entities()
|
148
|
+
return change
|
149
|
+
|
150
|
+
# Updated remove_world_entity method to add entities to the removal list
|
140
151
|
def remove_world_entity(self, *entities: bf.Entity):
|
141
|
-
"""
|
142
|
-
|
152
|
+
"""Mark world entities for removal from the scene."""
|
153
|
+
change = False
|
143
154
|
for e in entities:
|
144
155
|
if e in self.world_entities:
|
145
|
-
|
146
|
-
e
|
147
|
-
|
148
|
-
|
149
|
-
return removed
|
156
|
+
change = True
|
157
|
+
self.entities_to_remove.append(e)
|
158
|
+
e.set_parent_scene(None)
|
159
|
+
return change
|
150
160
|
|
151
161
|
def add_hud_entity(self, *entities: bf.Entity):
|
152
162
|
"""Add HUD entities to the scene."""
|
153
163
|
for e in entities:
|
154
164
|
if e not in self.hud_entities:
|
155
165
|
self.hud_entities[e] = None
|
156
|
-
e.
|
157
|
-
e.do_when_added()
|
166
|
+
e.set_parent_scene(self)
|
158
167
|
self.sort_entities()
|
159
168
|
return True
|
160
169
|
|
@@ -162,9 +171,8 @@ class Scene:
|
|
162
171
|
"""Remove HUD entities from the scene."""
|
163
172
|
for e in entities:
|
164
173
|
if e in self.hud_entities:
|
165
|
-
e.
|
166
|
-
e
|
167
|
-
del self.hud_entities[e]
|
174
|
+
e.set_parent_scene(None)
|
175
|
+
self.hud_entities.pop(e)
|
168
176
|
|
169
177
|
def add_actions(self, *action):
|
170
178
|
"""Add actions to the scene."""
|
@@ -255,16 +263,32 @@ class Scene:
|
|
255
263
|
|
256
264
|
def update(self, dt):
|
257
265
|
"""Update the scene. Do NOT override"""
|
266
|
+
if self.should_sort:
|
267
|
+
self._sort_entities_internal()
|
268
|
+
|
258
269
|
for entity in itertools.chain(
|
259
270
|
self.hud_entities.keys(), self.world_entities.keys()
|
260
271
|
):
|
261
272
|
entity.update(dt)
|
273
|
+
|
262
274
|
self.do_update(dt)
|
263
275
|
self.camera.update(dt)
|
264
276
|
self.hud_camera.update(dt)
|
265
277
|
self.actions.reset()
|
266
278
|
self.early_actions.reset()
|
267
279
|
|
280
|
+
|
281
|
+
if self.entities_to_add:
|
282
|
+
for e in self.entities_to_add:
|
283
|
+
self.world_entities[e] = None
|
284
|
+
self.entities_to_add.clear()
|
285
|
+
|
286
|
+
# Remove marked entities after updating
|
287
|
+
if self.entities_to_remove:
|
288
|
+
for e in self.entities_to_remove:
|
289
|
+
self.world_entities.pop(e, None)
|
290
|
+
self.entities_to_remove.clear()
|
291
|
+
|
268
292
|
def do_update(self, dt):
|
269
293
|
"""Specific update within the scene."""
|
270
294
|
pass
|
@@ -284,6 +308,9 @@ class Scene:
|
|
284
308
|
[draw_rect(data) for data in entity.get_debug_outlines()]
|
285
309
|
|
286
310
|
def sort_entities(self) -> None:
|
311
|
+
self.should_sort = True
|
312
|
+
|
313
|
+
def _sort_entities_internal(self):
|
287
314
|
"""Sort entities within the scene based on their rendering order."""
|
288
315
|
self.world_entities = OrderedDict(
|
289
316
|
sorted(self.world_entities.items(), key=lambda e: e[0].render_order)
|
@@ -291,6 +318,7 @@ class Scene:
|
|
291
318
|
self.hud_entities = OrderedDict(
|
292
319
|
sorted(self.hud_entities.items(), key=lambda e: e[0].render_order)
|
293
320
|
)
|
321
|
+
self.should_sort = False
|
294
322
|
|
295
323
|
def draw(self, surface: pygame.Surface):
|
296
324
|
self.camera.clear()
|
@@ -329,6 +357,7 @@ class Scene:
|
|
329
357
|
self.root.clear_hovered()
|
330
358
|
# self.root.clear_focused()
|
331
359
|
self.root.build()
|
360
|
+
bf.TimeManager().activate_register(self.name)
|
332
361
|
self.do_on_enter()
|
333
362
|
# self.root.visit(lambda e : e.resolve_constraints())
|
334
363
|
|
@@ -339,6 +368,7 @@ class Scene:
|
|
339
368
|
self.set_visible(False)
|
340
369
|
self.actions.hard_reset()
|
341
370
|
self.early_actions.hard_reset()
|
371
|
+
bf.TimeManager().deactivate_register(self.name)
|
342
372
|
self.do_on_exit()
|
343
373
|
|
344
374
|
def do_on_enter(self) -> None:
|
batFramework/sceneManager.py
CHANGED
@@ -10,16 +10,15 @@ def swap(lst, index1, index2):
|
|
10
10
|
class SceneManager:
|
11
11
|
def __init__(self) -> None:
|
12
12
|
self.scenes: list[bf.Scene] = []
|
13
|
-
self.shared_variables: dict = {}
|
14
13
|
self.shared_events = {pygame.WINDOWRESIZED}
|
15
14
|
|
16
15
|
self.set_sharedVar("in_cutscene", False)
|
17
16
|
self.set_sharedVar("player_has_control", True)
|
18
|
-
|
17
|
+
self.old_player_control = True
|
19
18
|
self.debug_mode: bf.enums.debugMode = bf.debugMode.HIDDEN
|
20
19
|
self.current_transitions: dict[str, bf.transition.Transition] = {}
|
21
20
|
|
22
|
-
def init_scenes(self, *initial_scenes):
|
21
|
+
def init_scenes(self, *initial_scenes:bf.Scene):
|
23
22
|
for index, s in enumerate(initial_scenes):
|
24
23
|
s.set_scene_index(index)
|
25
24
|
for s in reversed(initial_scenes):
|
@@ -51,18 +50,11 @@ class SceneManager:
|
|
51
50
|
print(f"[{str(name)} = {str(value)}]")
|
52
51
|
print("-" * 40)
|
53
52
|
|
54
|
-
def set_sharedVar(self, name, value) ->
|
55
|
-
|
56
|
-
Set a shared variable of any type. This will be accessible (read/write) from any scene
|
57
|
-
"""
|
58
|
-
self.shared_variables[name] = value
|
59
|
-
return True
|
53
|
+
def set_sharedVar(self, name, value) -> None:
|
54
|
+
bf.ResourceManager().set_sharedVar(name,value)
|
60
55
|
|
61
56
|
def get_sharedVar(self, name, error_value=None):
|
62
|
-
|
63
|
-
Get a shared variable
|
64
|
-
"""
|
65
|
-
return self.shared_variables.get(name, error_value)
|
57
|
+
return bf.ResourceManager().get_sharedVar(name, error_value)
|
66
58
|
|
67
59
|
def get_current_scene_name(self) -> str:
|
68
60
|
"""get the name of the current scene"""
|
@@ -129,11 +121,11 @@ class SceneManager:
|
|
129
121
|
def _start_transition(self, target_scene: bf.Scene):
|
130
122
|
target_scene.set_active(True)
|
131
123
|
target_scene.set_visible(True)
|
124
|
+
self.old_player_control = bool(self.get_sharedVar("player_has_control"))
|
132
125
|
self.set_sharedVar("player_has_control", False)
|
133
126
|
|
134
127
|
def _end_transition(self, scene_name, index):
|
135
128
|
self.set_scene(scene_name, index, True)
|
136
|
-
self.set_sharedVar("player_has_control", True)
|
137
129
|
self.current_transitions.clear()
|
138
130
|
|
139
131
|
def set_scene(self, scene_name, index=0, ignore_early: bool = False):
|
@@ -156,6 +148,9 @@ class SceneManager:
|
|
156
148
|
self.scenes[index].do_on_enter_early()
|
157
149
|
target_scene.on_enter()
|
158
150
|
|
151
|
+
self.set_sharedVar("player_has_control", self.old_player_control)
|
152
|
+
|
153
|
+
|
159
154
|
def cycle_debug_mode(self):
|
160
155
|
current_index = self.debug_mode.value
|
161
156
|
next_index = (current_index + 1) % len(bf.debugMode)
|
batFramework/scrollingSprite.py
CHANGED
@@ -99,17 +99,16 @@ class ScrollingSprite(bf.Sprite):
|
|
99
99
|
x += self.original_width
|
100
100
|
return self
|
101
101
|
|
102
|
-
def draw(self, camera: bf.Camera) ->
|
102
|
+
def draw(self, camera: bf.Camera) -> None:
|
103
103
|
if not (
|
104
104
|
self.visible
|
105
105
|
and (self.surface is not None)
|
106
106
|
and camera.rect.colliderect(self.rect)
|
107
107
|
):
|
108
|
-
return
|
109
|
-
self.surface.fill((0, 0, 0, 0))
|
110
|
-
|
111
|
-
[(self.original_surface, r) for r in self._get_mosaic_rect_list()]
|
108
|
+
return
|
109
|
+
# self.surface.fill((0, 0, 0, 0))
|
110
|
+
camera.surface.fblits(
|
111
|
+
[(self.original_surface, r.move(self.rect.x-camera.rect.x,self.rect.y-camera.rect.y)) for r in self._get_mosaic_rect_list()]
|
112
112
|
)
|
113
|
-
#
|
114
|
-
|
115
|
-
return 1
|
113
|
+
# camera.surface.blit(self.surface, camera.world_to_screen(self.rect))
|
114
|
+
return
|
batFramework/time.py
CHANGED
@@ -5,10 +5,10 @@ from typing import Self
|
|
5
5
|
class Timer:
|
6
6
|
_count: int = 0
|
7
7
|
|
8
|
-
def __init__(self, duration: float | int, end_callback, loop: bool = False) -> None:
|
8
|
+
def __init__(self, duration: float | int, end_callback, loop: bool = False, register="global") -> None:
|
9
9
|
self.name: int = Timer._count
|
10
10
|
Timer._count += 1
|
11
|
-
|
11
|
+
self.register = register
|
12
12
|
self.duration: int | float = duration
|
13
13
|
self.end_callback = end_callback
|
14
14
|
|
@@ -18,6 +18,9 @@ class Timer:
|
|
18
18
|
self.is_paused: bool = False
|
19
19
|
self.do_delete: bool = False
|
20
20
|
|
21
|
+
def __bool__(self)->bool:
|
22
|
+
return self.elapsed_time==-1 or self.is_over
|
23
|
+
|
21
24
|
def __repr__(self) -> str:
|
22
25
|
return f"Timer ({self.name}) {self.elapsed_time}/{self.duration} | {'loop ' if self.is_looping else ''} {'(D) ' if self.do_delete else ''}"
|
23
26
|
|
@@ -30,7 +33,7 @@ class Timer:
|
|
30
33
|
def start(self, force: bool = False) -> Self:
|
31
34
|
if self.elapsed_time != -1 and not force:
|
32
35
|
return self
|
33
|
-
if not bf.TimeManager().add_timer(self):
|
36
|
+
if not bf.TimeManager().add_timer(self,self.register):
|
34
37
|
return self
|
35
38
|
self.elapsed_time = 0
|
36
39
|
self.is_paused = False
|
@@ -79,36 +82,38 @@ class Timer:
|
|
79
82
|
def should_delete(self) -> bool:
|
80
83
|
return self.is_over or self.do_delete
|
81
84
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
self.active = active
|
86
|
-
self.timers: dict[int | str, Timer] = {}
|
87
|
-
|
88
|
-
def __iter__(self):
|
89
|
-
return iter(self.timers.values())
|
90
|
-
|
91
|
-
def add_timer(self, timer: Timer):
|
92
|
-
self.timers[timer.name] = timer
|
93
|
-
|
94
|
-
def update(self, dt):
|
95
|
-
expired_timers = []
|
96
|
-
for timer in list(self.timers.values()):
|
97
|
-
if not timer.is_paused:
|
98
|
-
timer.update(dt)
|
99
|
-
if timer.should_delete():
|
100
|
-
expired_timers.append(timer.name)
|
101
|
-
for name in expired_timers:
|
102
|
-
del self.timers[name]
|
103
|
-
|
85
|
+
class SceneTimer(Timer):
|
86
|
+
def __init__(self, duration: float | int, end_callback, loop: bool = False, scene_name:str = "global") -> None:
|
87
|
+
super().__init__(duration, end_callback, loop, scene_name)
|
104
88
|
|
105
89
|
class TimeManager(metaclass=bf.Singleton):
|
90
|
+
class TimerRegister:
|
91
|
+
def __init__(self, active=True):
|
92
|
+
self.active = active
|
93
|
+
self.timers: dict[int | str, Timer] = {}
|
94
|
+
|
95
|
+
def __iter__(self):
|
96
|
+
return iter(self.timers.values())
|
97
|
+
|
98
|
+
def add_timer(self, timer: Timer):
|
99
|
+
self.timers[timer.name] = timer
|
100
|
+
|
101
|
+
def update(self, dt):
|
102
|
+
expired_timers = []
|
103
|
+
for timer in list(self.timers.values()):
|
104
|
+
if not timer.is_paused:
|
105
|
+
timer.update(dt)
|
106
|
+
if timer.should_delete():
|
107
|
+
expired_timers.append(timer.name)
|
108
|
+
for name in expired_timers:
|
109
|
+
del self.timers[name]
|
110
|
+
|
106
111
|
def __init__(self):
|
107
|
-
self.registers = {"global": TimerRegister()}
|
112
|
+
self.registers = {"global": TimeManager.TimerRegister()}
|
108
113
|
|
109
114
|
def add_register(self, name, active=True):
|
110
115
|
if name not in self.registers:
|
111
|
-
self.registers[name] = TimerRegister(active)
|
116
|
+
self.registers[name] = TimeManager.TimerRegister(active)
|
112
117
|
|
113
118
|
def add_timer(self, timer, register="global") -> bool:
|
114
119
|
if register in self.registers:
|
batFramework/transition.py
CHANGED
@@ -87,7 +87,7 @@ class Transition:
|
|
87
87
|
class FadeColor(Transition):
|
88
88
|
def __init__(
|
89
89
|
self,
|
90
|
-
color: tuple
|
90
|
+
color: tuple,
|
91
91
|
middle_duration: float,
|
92
92
|
first_duration: float = None,
|
93
93
|
second_duration: float = None,
|
@@ -98,16 +98,25 @@ class FadeColor(Transition):
|
|
98
98
|
first_duration = middle_duration
|
99
99
|
if second_duration is None:
|
100
100
|
second_duration = middle_duration
|
101
|
-
|
101
|
+
|
102
102
|
self.first = Fade(first_duration)
|
103
|
+
self.second = Fade(second_duration)
|
103
104
|
self.color = color
|
104
|
-
self.
|
105
|
-
|
106
|
-
|
107
|
-
self.timer = bf.Timer(
|
108
|
-
|
109
|
-
)
|
110
|
-
|
105
|
+
self.middle_duration = middle_duration
|
106
|
+
self.index = 0
|
107
|
+
|
108
|
+
self.timer = bf.Timer(middle_duration, self.transition_to_second)
|
109
|
+
self.first.set_end_callback(self.transition_to_middle)
|
110
|
+
self.second.set_end_callback(self.transition_to_end)
|
111
|
+
|
112
|
+
def transition_to_middle(self):
|
113
|
+
self.next_step(self.timer.start)
|
114
|
+
|
115
|
+
def transition_to_second(self):
|
116
|
+
self.next_step(self.second.start)
|
117
|
+
|
118
|
+
def transition_to_end(self):
|
119
|
+
self.next_step(self.end)
|
111
120
|
|
112
121
|
def next_step(self, callback=None) -> None:
|
113
122
|
self.index += 1
|
@@ -125,6 +134,7 @@ class FadeColor(Transition):
|
|
125
134
|
def start(self):
|
126
135
|
if self.start_callback:
|
127
136
|
self.start_callback()
|
137
|
+
|
128
138
|
self.color_surf = pygame.Surface(self.source.get_size())
|
129
139
|
self.color_surf.fill(self.color)
|
130
140
|
|
@@ -141,7 +151,7 @@ class FadeColor(Transition):
|
|
141
151
|
self.second.draw(surface)
|
142
152
|
|
143
153
|
def skip(self, no_callback: bool = False):
|
144
|
-
if
|
154
|
+
if not no_callback and self.end_callback:
|
145
155
|
self.end_callback()
|
146
156
|
|
147
157
|
self.first.controller.stop()
|
@@ -149,6 +159,7 @@ class FadeColor(Transition):
|
|
149
159
|
self.second.controller.stop()
|
150
160
|
|
151
161
|
|
162
|
+
|
152
163
|
class Fade(Transition):
|
153
164
|
def end(self):
|
154
165
|
self.dest.set_alpha(255)
|
@@ -213,3 +224,5 @@ class CircleIn(Transition):
|
|
213
224
|
)
|
214
225
|
mask = pygame.mask.from_surface(self.circle_surf)
|
215
226
|
mask.to_surface(surface=surface, setsurface=self.source, unsetsurface=self.dest)
|
227
|
+
|
228
|
+
|
batFramework/utils.py
CHANGED
@@ -5,6 +5,11 @@ import batFramework as bf
|
|
5
5
|
import json
|
6
6
|
from .enums import *
|
7
7
|
import re
|
8
|
+
from typing import Callable, TYPE_CHECKING, Any
|
9
|
+
from functools import cache
|
10
|
+
if TYPE_CHECKING:
|
11
|
+
from .object import Object
|
12
|
+
from .entity import Entity
|
8
13
|
|
9
14
|
|
10
15
|
class Singleton(type):
|
@@ -27,8 +32,6 @@ class Utils:
|
|
27
32
|
with their tuple coordinates as keys.
|
28
33
|
Exemple : '(0,0) : Surface'
|
29
34
|
"""
|
30
|
-
if surface is None:
|
31
|
-
return None
|
32
35
|
width, height = surface.get_size()
|
33
36
|
res = {}
|
34
37
|
for iy, y in enumerate(range(0, height, split_size[1])):
|
@@ -57,3 +60,61 @@ class Utils:
|
|
57
60
|
return pattern.sub("", s)
|
58
61
|
|
59
62
|
return filter_function
|
63
|
+
|
64
|
+
|
65
|
+
@staticmethod
|
66
|
+
@cache
|
67
|
+
def draw_spotlight(inside_color, outside_color, radius, radius_stop=None, dest_surf=None,size=None):
|
68
|
+
"""
|
69
|
+
Draws a circle spotlight centered on a surface
|
70
|
+
inner color on the center
|
71
|
+
gradient towards outside color from radius to radius stop
|
72
|
+
surface background is made transparent
|
73
|
+
if des_surf is None:
|
74
|
+
if size is None : size is radius_stop*radius_stop
|
75
|
+
returns the newly created surface of size 'size' with the spotlight drawn
|
76
|
+
|
77
|
+
"""
|
78
|
+
if radius_stop is None:
|
79
|
+
radius_stop = radius
|
80
|
+
diameter = radius_stop * 2
|
81
|
+
|
82
|
+
|
83
|
+
if dest_surf is None:
|
84
|
+
if size is None:
|
85
|
+
size = (diameter,diameter)
|
86
|
+
dest_surf = pygame.Surface(size, pygame.SRCALPHA)
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
dest_surf.fill((0,0,0,0))
|
92
|
+
center = dest_surf.get_rect().center
|
93
|
+
|
94
|
+
if radius_stop != radius:
|
95
|
+
for r in range(radius_stop, radius - 1, -1):
|
96
|
+
color = [
|
97
|
+
inside_color[i] + (outside_color[i] - inside_color[i]) * (r - radius) / (radius_stop - radius)
|
98
|
+
for i in range(3)
|
99
|
+
] + [255] # Preserve the alpha channel as fully opaque
|
100
|
+
pygame.draw.circle(dest_surf, color, center, r)
|
101
|
+
else:
|
102
|
+
pygame.draw.circle(dest_surf, inside_color, center, radius)
|
103
|
+
|
104
|
+
return dest_surf
|
105
|
+
|
106
|
+
|
107
|
+
@staticmethod
|
108
|
+
def animate_move(entity:"Object", start_pos : tuple[float,float], end_pos:tuple[float,float])->Callable[[float],None]:
|
109
|
+
def func(x):
|
110
|
+
entity.set_center(start_pos[0]+(end_pos[0]-start_pos[0])*x,start_pos[1]+(end_pos[1]-start_pos[1])*x)
|
111
|
+
return func
|
112
|
+
|
113
|
+
@staticmethod
|
114
|
+
def animate_alpha(entity:"Entity", start : int, end:int)->Callable[[float],None]:
|
115
|
+
def func(x):
|
116
|
+
entity.set_alpha(int(pygame.math.clamp(start+(end-start)*x,0,255)))
|
117
|
+
return func
|
118
|
+
|
119
|
+
|
120
|
+
|
@@ -1,58 +1,58 @@
|
|
1
|
-
batFramework/__init__.py,sha256=
|
1
|
+
batFramework/__init__.py,sha256=gQxP43sMutQeN4dnbO6M8uT3ghN87gyNmcmurtSd33A,2172
|
2
2
|
batFramework/action.py,sha256=919IVYKviLyVYDtQL7oZvlVuE_aodjJCuwz6fGi5sCk,8420
|
3
3
|
batFramework/actionContainer.py,sha256=qy6-YY3iX26KJ8NqFMSYo6JExohD8HFk0sC1qhb7qA8,2602
|
4
|
-
batFramework/animatedSprite.py,sha256=
|
5
|
-
batFramework/audioManager.py,sha256=
|
4
|
+
batFramework/animatedSprite.py,sha256=QmYfOw9fgcGRrXregOsEJquobhGWeWSY-L7nkzjY83w,4987
|
5
|
+
batFramework/audioManager.py,sha256=8tKSf4huZe5tgH98qHlKoFNjXPGDQNJho6PKfSCe7JA,3869
|
6
6
|
batFramework/camera.py,sha256=u1EPSitZ9mEEa32yQB7K6ywnWgWCSumbhrc4HRjimEY,9406
|
7
7
|
batFramework/constants.py,sha256=5PyZQZ4fCcLA8k_Upby9KGVF-3pnV2ZZ6t26CxiocPM,1102
|
8
|
-
batFramework/cutscene.py,sha256=
|
9
|
-
batFramework/cutsceneBlocks.py,sha256=
|
10
|
-
batFramework/dynamicEntity.py,sha256=
|
8
|
+
batFramework/cutscene.py,sha256=Jh2g-zC3zaUSQoO2uVOsirWkuLAUFugu2T8B_ob9IPQ,4007
|
9
|
+
batFramework/cutsceneBlocks.py,sha256=3jtmTpV48NKCu-Qgjg7KN5KnwXn0kycIQ7t7G3RH3VE,4862
|
10
|
+
batFramework/dynamicEntity.py,sha256=LR8DeDa2h6jhDTM6yt61C_0AdYEzvq84NlB5a17K4nM,830
|
11
11
|
batFramework/easingController.py,sha256=4N8GIp1fsaWBUlDxXx3SMwOq1Mrhn10MZZIO51_CRnk,1677
|
12
12
|
batFramework/entity.py,sha256=34gYC6uEMmLkqWtoTG9bgMWRmHRSxhQfxXZKzWS7H2o,2127
|
13
13
|
batFramework/enums.py,sha256=Iee21l4BajM7PXXrZF8SWAURX4qwMqKpQ7f12btqIbM,2077
|
14
14
|
batFramework/fontManager.py,sha256=VX3HmtyeiOBtv64XZjjJrvk29w6lawHKLfCGBwAa-4g,2242
|
15
15
|
batFramework/manager.py,sha256=YRKKv5qWVUs7D8ZqP8ZkfUeTCc3lHxfCfJSYdO5Ep8A,2375
|
16
16
|
batFramework/object.py,sha256=SnwnAmfC-7_QTGomQVpBQGSMQjN5NngZoNuvGdqHUrE,3021
|
17
|
-
batFramework/particle.py,sha256=
|
17
|
+
batFramework/particle.py,sha256=du6KwUH_WGgju11-_dQlxkcW16qdsVu8Q8qEwVuztFY,2633
|
18
18
|
batFramework/renderGroup.py,sha256=_VDvmP4iB-XarFJo_Uh5YKwWq1cazHmOBmTXZkqKk40,2020
|
19
|
-
batFramework/resourceManager.py,sha256=
|
20
|
-
batFramework/scene.py,sha256=
|
21
|
-
batFramework/sceneManager.py,sha256=
|
22
|
-
batFramework/scrollingSprite.py,sha256=
|
19
|
+
batFramework/resourceManager.py,sha256=0cOIAFXT7UzzvgHn9QkWcXsTp8H2bIS70NvvgpBL2_4,3554
|
20
|
+
batFramework/scene.py,sha256=zUVYDspPUShDAYJBA7eV_qWGVmb1SAKso06vRcIKyI4,12197
|
21
|
+
batFramework/sceneManager.py,sha256=ezAVtgc886tb9q2xQwHonRrEAZk8MDWdNFPAFWsFM_o,7086
|
22
|
+
batFramework/scrollingSprite.py,sha256=PPEieAaFcOLE_Lm7cnm3xc7XyLKopCPcDbXEfyThO48,4133
|
23
23
|
batFramework/sprite.py,sha256=t_kSyUXGOSXQbSBwrKgBUTp5mITeFQbAKNzugjL5SgY,1625
|
24
24
|
batFramework/stateMachine.py,sha256=tDQIfQH_4cVZyVNYJ2APe8-yhos3uGk5uSMo_XvktdQ,1335
|
25
25
|
batFramework/tileset.py,sha256=3AJBWHx90PC43BdLYCBFm811XBrMvWoB-nsUgyo6s-I,1728
|
26
|
-
batFramework/time.py,sha256=
|
27
|
-
batFramework/transition.py,sha256=
|
26
|
+
batFramework/time.py,sha256=bq24XjO2tZUX_i_BOQ-ccnddu7UUEG3-Gnz1P3IHbcU,4411
|
27
|
+
batFramework/transition.py,sha256=67K9TrHQnNXfP9CQXnP__fv1Piewcm4p4n1tBi0veuA,6641
|
28
28
|
batFramework/triggerZone.py,sha256=ikOOlJT1KIND0MO2xiilCHuKlb1eQhkCMEhZTi1btsI,586
|
29
|
-
batFramework/utils.py,sha256=
|
29
|
+
batFramework/utils.py,sha256=OSVUvpWtS1BjRpJql_pwnlO76WhTLs9d_K6oONepIUI,3758
|
30
30
|
batFramework/gui/__init__.py,sha256=17ij7mrCBCoehqCq1PV6MSXPOfMoLPmrV_G8d6ax4Tk,687
|
31
31
|
batFramework/gui/button.py,sha256=Ozs6VKHf9FCQXQODDiLQywGN3hwfXtQ6s2I-rzdjnQg,429
|
32
|
-
batFramework/gui/clickableWidget.py,sha256=
|
32
|
+
batFramework/gui/clickableWidget.py,sha256=LTTjLUq8WouEMNf8dwHTkKcOVe4Etyw6lOjxEjovtYw,7058
|
33
33
|
batFramework/gui/container.py,sha256=wXjuhwCJc71KKSgY2cYgoRscAKB_hIw5N4njJk3Z9lk,5925
|
34
34
|
batFramework/gui/debugger.py,sha256=XogxF3J31GO-DZZn6YBrgwpYA5WjadzEfHkQHeMLU7o,3925
|
35
35
|
batFramework/gui/dialogueBox.py,sha256=3Z76l9obrpQImI8hjoBS_8G9sY3UILj2d3nJsaxtaI4,3221
|
36
36
|
batFramework/gui/draggableWidget.py,sha256=SKG7oMInZ_GTnrbv2T0aqlppuiuLX1tkVSCQJtRMlk8,1392
|
37
37
|
batFramework/gui/image.py,sha256=3J1v_YGDPUE_5CwD0ca9PXhHYOdItxUbXakovDjKms4,1750
|
38
38
|
batFramework/gui/indicator.py,sha256=leCvxsGxt00-oTn0N5MTmLstLH9uLG3RjQ02KlXtZCQ,1549
|
39
|
-
batFramework/gui/interactiveWidget.py,sha256=
|
40
|
-
batFramework/gui/label.py,sha256=
|
39
|
+
batFramework/gui/interactiveWidget.py,sha256=NIacinJkRV6ClqR8TPF39bi1cP4qVeBaOJtVrBqD6hw,5305
|
40
|
+
batFramework/gui/label.py,sha256=mlIwhC_006z1jZ8HbBbyMeuNRIxbmGkyQUt2NU4kSB0,10979
|
41
41
|
batFramework/gui/layout.py,sha256=sslcKULrWKZzaJw_fyb3f9A3PTT3Bm85C8-RbMHeDzo,8377
|
42
42
|
batFramework/gui/meter.py,sha256=-5FwPpwWJm3nn8_SoWJNrOqIZ2wiHHTWmpkJyNNaCCY,2282
|
43
43
|
batFramework/gui/radioButton.py,sha256=MAlu1_EiPzbvm6TyQ-IITWR6Mv38W2qEOaOKu1MArNQ,2406
|
44
|
-
batFramework/gui/root.py,sha256=
|
45
|
-
batFramework/gui/shape.py,sha256=
|
46
|
-
batFramework/gui/slider.py,sha256=
|
44
|
+
batFramework/gui/root.py,sha256=K75814ct6AF4LF8cyzmtUmnTmSflJRnHVMGbpUXwmkE,5084
|
45
|
+
batFramework/gui/shape.py,sha256=mg-H4bHtnlYnaa4JkOTmX5MNTzwVADmeoSqeMvgenck,9968
|
46
|
+
batFramework/gui/slider.py,sha256=GJ5pR0WoObUzfD4j4xak7eLMDtszggZJPCbE7Rf42Co,7670
|
47
47
|
batFramework/gui/style.py,sha256=OeLbft0RkIslQ2IcZpBeF6TaQDONIoBcAHj_Bkh9gFw,131
|
48
48
|
batFramework/gui/styleManager.py,sha256=rALKJ-AmRbDAiyu8hVAYRAlkQxw677DiPoNKJZ4xtJ4,1245
|
49
|
-
batFramework/gui/textInput.py,sha256=
|
50
|
-
batFramework/gui/toggle.py,sha256=
|
51
|
-
batFramework/gui/widget.py,sha256=
|
49
|
+
batFramework/gui/textInput.py,sha256=orDq1cfBFjHU41UqtzH3unoZiVZYmSr-HQ84u5lwfwE,4633
|
50
|
+
batFramework/gui/toggle.py,sha256=gQTA7fScTlScFWOXxoyJT6wcdjig-dRx7OiiPBq7Yyg,3843
|
51
|
+
batFramework/gui/widget.py,sha256=nTAp5oPvr6688KXhmSzjHPNocR8rRTYOH6YZ8SIUB3o,12712
|
52
52
|
batFramework/gui/constraints/__init__.py,sha256=qqXE8nnSrEvCSeHdqY8UYPZLetqdubFPI7IdZuh35QE,26
|
53
|
-
batFramework/gui/constraints/constraints.py,sha256=
|
54
|
-
batframework-1.0.
|
55
|
-
batframework-1.0.
|
56
|
-
batframework-1.0.
|
57
|
-
batframework-1.0.
|
58
|
-
batframework-1.0.
|
53
|
+
batFramework/gui/constraints/constraints.py,sha256=ku1vJ4MbnP5KzWrowRM4ydJCs4dJpUVL_iJKKiJna7I,24616
|
54
|
+
batframework-1.0.8a4.dist-info/LICENCE,sha256=A65iXbMDbOxQLDNOODJLqA7o5RxszYlEqIgNSzBQRf4,1073
|
55
|
+
batframework-1.0.8a4.dist-info/METADATA,sha256=WYIlb6kPrHg-06QOFHxrVRBx-qOZoUw8yCXT8rF98XA,2501
|
56
|
+
batframework-1.0.8a4.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
57
|
+
batframework-1.0.8a4.dist-info/top_level.txt,sha256=vxAKBIk1oparFTxeXGBrgfIO7iq_YR5Fv1JvPVAIwmA,13
|
58
|
+
batframework-1.0.8a4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|