Пример #1
0
 def __init__(self, dispatcher: EventDispatcher, initial_scene: Scene=None):
     self.scenes = {}
     self.__buffered_scene__ = None
     self.__current_scene_index__ = None
     if initial_scene is not None:
         self.add_scene(initial_scene)
     self.resized = Event(self)
     self.scene_changed = Event(self)
     self.dispatcher = dispatcher
     if initial_scene is not None:
         self.choose_scene(initial_scene.name)
Пример #2
0
 def __init__(self):
     self.start_time = None
     self.current_cycle = 1
     self.limit = DEFAULT_LIFECYCLE_TIME
     self.cycle_changed = Event(self)
     self.cycle_end = Event(self)
     self.end = False
     self.passed = 0
     self.stop_time = None
     self.paused = False
     self.all_time_passed = 0
Пример #3
0
 def __init__(self, name="Scene", *args: SceneLayer):
     self.name = name
     self.layers = {}
     self.dispatcher = EventDispatcher()
     self.layers_coll = []
     self.scene_end = Event(self)
     self.scene_start = Event(self)
     # TODO: Animation sequences for each scene
     # (Loading, Popup backdrop, etc.)
     self.sequences = []
     for i in args:
         self.append_layer(i)
Пример #4
0
 def __init__(self, position: Point, width=0, height=0, back_color=(0, 0, 0)):
     self._position = position
     self._sprite = None
     self.alignment = AlignStyle.NONE
     self._anchors = self.ANCHOR_LEFT
     self.visible = True
     self.flag = False
     self.margin = Margin()
     self._parent = None
     self.activated = False
     self.centeredly_drawn = False
     self._width = width
     self._anc_dist = Margin()
     self._height = height
     self.region = RectangularRegion(position, position + Point(width, 0),
                                     position + Point(width, height),
                                     position + Point(0, height))
     self.click_event = Event(self)
     self.click = Event(self)
     self.released = Event(self)
     self.double_clicked = Event(self)
     self.mouse_press = Event(self)
     self.mouse_motion = Event(self)
     self.mouse_enter = Event(self)
     self.mouse_leave = Event(self)
     self._dock = DockStyle.NONE
     self._mouse_down = False
     self._opacity = 255
     self._mouse_enter = False
     self._mouse_enter_time = 0
     self._color = (0, 0, 0)
     self.fore_color = self._color
     self.back_color = back_color
Пример #5
0
 def __init__(self):
     self.total_score = 0
     self.factor = 1
     self.stages = 1
     self.energy_point = 1
     self.increment = 1
     self.score_changed = Event(self)
Пример #6
0
 def __init__(self,
              position: Point,
              width: int = 500,
              height: int = 500,
              color: tuple = arcade.color.AMARANTH_PINK):
     self.children = []
     self._padding = Padding(0, 0, 0, 0)
     self._child_spr_list = ExtendedSpriteList()
     self._shape = None
     self._texture = None
     self._background_drawn = True
     self.window_resize = Event(self)
     super().__init__(position, width, height, back_color=color)
Пример #7
0
 def __init__(self, sprite_name, initial_pos=(0, 0), scaling=1):
     x, y = LocationUtil.get_sprite_position(*initial_pos)
     # TODO: Absolute and Relative position
     self.sprite_name = sprite_name
     self.sprite = arcade.Sprite(sprite_name)
     self.sprite_list = []
     self.sprite_list.append(self.sprite)
     self.scaling = scaling
     self.sprite.width = 18
     self.sprite.height = 18
     self.dead = False
     super().__init__([x, y], 9)
     self.sprite.change_x = 5
     self.sprite.change_y = 5
     self.z_order_changed = Event(self)
Пример #8
0
 def __init__(self, position, width, height):
     super().__init__(position, width, height)
     self.selected_index_changed_event = Event(self)
     self.navigated = Event(self)
     self.__items__ = []
     self._current_index = -1
Пример #9
0
 def __init__(self, duration):
     self.start_behaviour = SceneSequence.TIME_CONTROLLED
     self.duration = duration
     self.started_event = Event(self)
     self.finished_event = Event(self)