I need help with my coding and I need to know how to configure my text for my button, Here is my code so far:
class EyeSprite(Sprite):
def __init__(self, game):
Sprite.__init__(self, game)
self.images = [
PhotoImage(file="C:\\Users\\John Magana\\Desktop\\Python
Projects\\clicker game folder\\eye1.png")
]
self.current_image = 0
self.current_image_add = 1
self.last_time = time.time()
self.this_time = time.time()
self.clickedcount = 0
self.autoclickers = 0
self.cost = 10
self.text = g.canvas.create_text(60, 10, anchor='w', fill='black', font='Arial 20', text='You have: %s click points'% self.clickedcount)
self.textauto = g.canvas.create_text(60, 260, anchor='w', fill='black', font='Arial 20', text='You have: %s autoclickers'% self.autoclickers)
self.image = game.canvas.create_image(145, 10, image = self.images[0], anchor='nw')
game.canvas.bind_all('<Button-1>', self.clicked)
global autoclickerbuy
autoclickerbuy = False
starttime = time.time()
self.buttontext = ('Autoclicker: %s points: 20Clicks' % self.cost)
pointbutton1 = Button(text=self.buttontext, fg='black', command=self.autoclicker)
pointbutton1.pack(anchor='w')
how do I configure the button text so when it is clicked it will update to a new variable?