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, 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, type, x, y): super().__init__() self.setType("pickup") # add texture texture = Image("assets/dickbutt.png") texture.setSize(64, 64) if texture: texture.setDepth(10) self.assignDrawable(texture) self.size = texture.getSize() self.setDepth(10)
def __init__(self, type, x, y): super().__init__(); self.setType("pickup"); # add texture texture = Image("assets/dickbutt.png"); texture.setSize(64,64); if texture: texture.setDepth(10); self.assignDrawable(texture); self.size = texture.getSize(); self.setDepth(10);
def __init__(self): super().__init__(); screenSize = Global.getScreenSize(); background = Image("assets/cinematics/test.png"); background.setSize(screenSize[0], screenSize[1]); background.setDepth(200); character = Image("assets/characterTest.png"); character.setPosition(100,100); character.setSize(100,100); character.setDepth(201); self.append(character, "character"); self.moveElementTo("character", 200,200, 2000); Global.setTimeout(self.whenArriveToEnd, 2000); self.setBackground(background);
def __init__(self): super().__init__() screenSize = Global.getScreenSize() background = Image("assets/cinematics/test.png") background.setSize(screenSize[0], screenSize[1]) background.setDepth(200) character = Image("assets/characterTest.png") character.setPosition(100, 100) character.setSize(100, 100) character.setDepth(201) self.append(character, "character") self.moveElementTo("character", 200, 200, 2000) Global.setTimeout(self.whenArriveToEnd, 2000) self.setBackground(background)
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);
def updateEntries(self): self.update(); for entry in self.entries: for element in self.elements: if element == entry: type = self.elements[element].getType(); if type == "text": text = self.getEntry(element); self.elements[element].setValue(text); elif type == "image": sX = Global.screenSize[0]; sY = Global.screenSize[1]; character = self.getEntry(element); print("Current character speaking:", character); tempImage = Image("assets/characters/" + character + "/face.png"); tempImage.setPosition(0.05*sX, 0.78 * sY); tempImage.setSize(0.1*sX, 0.1*sX); tempImage.setDepth(5); self.elements[element] = tempImage;
def updateEntries(self): self.update() for entry in self.entries: for element in self.elements: if element == entry: type = self.elements[element].getType() if type == "text": text = self.getEntry(element) self.elements[element].setValue(text) elif type == "image": sX = Global.screenSize[0] sY = Global.screenSize[1] character = self.getEntry(element) print("Current character speaking:", character) tempImage = Image("assets/characters/" + character + "/face.png") tempImage.setPosition(0.05 * sX, 0.78 * sY) tempImage.setSize(0.1 * sX, 0.1 * sX) tempImage.setDepth(5) self.elements[element] = tempImage