def addBackground(self, parallax): """ Adds a background to the preview @type parallax: tilemap.Parallax @param parallax: the background to add """ self.__layers.append(graphics.loadImage(parallax.fileName)) self.__backgrounds.append(parallax) self.__redrawBuffer() self.queue_draw()
def openTileSet(self, fileName): """ Opens an image file and adds it to the list of open images @type fileName: string @param fileName: the name of the file to open @rtype: int @return: the opened image's index """ image = graphics.loadImage(fileName) if image is not None: self.__images.append(image) index = len(self.__images) - 1 self.__map.addImage(fileName, index) return index else: return None