def added_to_stage(self, stage):
"""
adjusts our max positions based on the stage's level's dimensions - only if it's a Level (not a simple Screen)
:param Stage stage: the Stage we were added to
"""
# TODO: make this independent on Level or simple Screen (even a Screen should have dimensions)
if isinstance(stage.screen, Level):
if self.x_min == "auto":
self.x_min = 0
if self.x_max == "auto":
self.x_max = stage.screen.width - self.rect.width
if self.y_min == "auto":
self.y_min = 0
if self.y_max == "auto":
self.y_max = stage.screen.height - self.rect.height
评论列表
文章目录