extra/editor/image_viewer.py
browsing at commit = d05a48cfebe2913e6f0a54ae03fa0a94dbfca41d
#! /bin/python3
import tkinter as tk
from image_frame import *
#This is the raltive directory to the base of the SagoSprite dir
#I am launching from extra/editor so I need to go two levels up
BASEDIR = '../..'
if __name__ == "__main__":
root = tk.Tk()
image = tk.PhotoImage(file=BASEDIR+'/data/textures/terrain.png')
imageFrame = ImageFrame(root, image)
imageFrame.get_frame().pack(expand=tk.YES, fill=tk.BOTH)
import os
textures = os.listdir(BASEDIR+"/data/textures")
textures = list(filter(lambda x: x.endswith('.png'), textures))
sprites = os.listdir(BASEDIR+"/data/sprites")
sprites = list(filter(lambda x: x.endswith('.sprite'), sprites))
print(textures, sprites)
root.mainloop()