Hi. I’m attempting to code a textbox GUI element in Python that changes text according to a messege it recieves. However, for some reason the message sensor method getBodies does not return anything! Heres my code:
#This function handles the events of various control functions.
#In other words, it calls callback functionsimport GameLogic
#the string tables
stringtable = [‘Hello. Welcome to Bouncie.
Test
Test
More Test
s.’]#the callback functions
#The function callback/functions for a TextBox
def TB1_TextChange():
print “Text Change Event!”
sensor = controller.getSensors()
print dir(sensor[0])
print sensor[0].getBodies()#Detect which function to call and call it
controller = GameLogic.getCurrentController()
owner = controller.getOwner()if owner.state == 1: #for things like buttons.
owner.state = 0
exec owner.FunctionCallback