The goal is to have a character sprite that can move around in a box. The box to the left is where the visuals are, and the right are descriptions (etc). At the bottom there is a text box so the user can enter commands. Here's an image to demonstrate. I don't want the character to be able to move into the text. How would I go about doing this using Tkinter? Here's the code for setting up the GUI:
def setUpGui(self):
self.pack(fill = BOTH, expand = 1)
#Setting up player input region of the GUI
Game.player_input = Entry(self, bg = "white")
#Executes process when enter pressed
Game.player_input.bind("<Return>", self.process)
#Stretches it across the bottom
Game.player_input.pack(side = BOTTOM, fill = X)
#Makes this the focus upon running the program
Game.player_input.focus()
img =None
Game.image = Label(self, width = WIDTH/2, image = img)
Game.image.image = img
Game.image.pack(side = LEFT, fill = Y)
Game.image.pack_propagate(False)
text_frame = Frame(self, width = WIDTH/2)
Game.text = Text(text_frame, bg = "lightgrey", state = DISABLED)
Game.text.pack(side = RIGHT, fill = Y)
text_frame.pack(side = RIGHT, fill = Y)
text_frame.pack_propagate(False)
def setRoomImage(self):
if (Game.currentRoom == None):
Game.img = PhotoImage(file = "skull.gif")
else:
Game.img = PhotoImage(file = Game.currentRoom.image)
Game.image.config(image = Game.img)
Game.image.image = Game.img