def __init__(self, path, sceneWidth): super().__init__() self.setType("background") # texture texture = Image(path) texture.setDepth(0) # size self.assignDrawable(texture) self.setDepth(-10) # left leftPanel = Image("assets/dot.png") leftPanel.setSize(texture.getSize()[0] / 2, 400) leftPanel.setOffsetPosition(-texture.getSize()[0] / 2, 0) leftPanel.setAffectedByParent(False) self.assignDrawable(leftPanel) # right rightPanel = Image("assets/dot.png") rightPanel.setSize(texture.getSize()[0] / 2, 400) rightPanel.setOffsetPosition(sceneWidth, 0) rightPanel.setAffectedByParent(False) self.assignDrawable(rightPanel)
def __init__(self, position, targetScene, targetPosition): super().__init__() self.setType("teleportation") self.uniqid = uuid.uuid4() self.action = ActionDispatcher(self.uniqid, position[0], position[1]) self.receiver = ActionReceiver(self.uniqid) self.receiver.on(self.doTeleport) texture = Image("assets/icons/door.png") texture.setSize(64, 64) texture.setOffsetPosition(93, 300) texture.setDepth(101) self.assignDrawable(texture) self.setPosition(position[0], position[1]) self.targetScene = targetScene self.targetPosition = targetPosition Render.set(texture)
def __init__(self, position, targetScene, targetPosition): super().__init__(); self.setType("teleportation"); self.uniqid = uuid.uuid4(); self.action = ActionDispatcher(self.uniqid, position[0], position[1]); self.receiver = ActionReceiver(self.uniqid); self.receiver.on(self.doTeleport); texture = Image("assets/icons/door.png"); texture.setSize(64,64); texture.setOffsetPosition(93,300); texture.setDepth(101); self.assignDrawable(texture); self.setPosition(position[0], position[1]); self.targetScene = targetScene; self.targetPosition = targetPosition; Render.set(texture);