#  -*- coding: UTF-8 -*-

# MindPlus
# Python
from unihiker import Audio
from unihiker import GUI
import time

# 事件回调函数
def button_click1():
    global my_variable
    my_variable = 1
    thread1=u_gui.start_thread(u_thread1_function)
def u_thread1_function():
    u_audio.start_play("muyu.mp3")
    text=u_gui.draw_text(text="功德+1",x=40,y=100,font_size=10, color="#000000")
    for ZuoBiao in range(80, 69, -1):
        text.config(y=ZuoBiao)
        time.sleep(0.1)
    text.remove()


u_gui=GUI()
u_audio = Audio()
a=u_gui.draw_image(image="bg1.jpg",x=120,y=160)
a.config(w=240)
a.config(origin="center")
pic=u_gui.draw_image(image="my.png",x=120,y=160)
pic.config(w=140)
pic.config(origin="center")
pic1=u_gui.draw_image(image="g.png",x=120,y=70)
pic1.config(w=140)
pic1.config(onclick=button_click1)
pic.config(onclick=button_click1)
my_variable = 0

while True:
    if (my_variable == 1):
        pic1.config(image="g1.png")
        pic.config(w=130)
        pic1.config(image="g.png")
        pic.config(w=140)
        my_variable = 0
