def __init__(self): World.__init__(self) self.add_graphic(Image('EntityImage2.png'), 0, 50, 50) self.colortween = ColorTween(_type = Tween.LOOPING) self.add_tween(self.colortween) self.colortween.tween(5, 0xFF0000, 0x0000FF, ease=Ease.bounce_in_out) self.test = Image.create_rect(100, 100, 0x993333, 0.75) self.test.x = 200 self.test.y = 200 text = Text('Hello', 100, 100, size=48) gl = Graphiclist(self.test, text) self.add_graphic(gl, -1) self.game_entity = GameEntity() self.add(self.game_entity) self._button = Button(400, 200, self.on_button_click) self._button.set_spritemap('ButtonSheet.png', 50, 40) self.add(self._button)
def update(self): World.update(self) self.test.color = self.colortween.color