'clicker game various images
I am making a ui for clicker game and its supposed to change images on certain values that the price and popularity are at but the images seem to be stacking on each other can anyone help. I also left most of the code out other than this since I am pretty sure everything else is irrelevant.
price = 1000
popularity = 10
def update_ui():
price_fully_high_meter["value"] = price
popularity_fully_high_text.config(text="full popularity" + str(popularity))
popularity_fully_high_meter["value"] = popularity
price_fully_high_text.config(text="full price" + str(price))
if price >= 0 and price <= 10000 and popularity >=0 and popularity <20:
image_label1.config(image=resized_bitcoin_low)
bitcoin_condition.config(text="My value is rockbottom!!")
elif price >= 11000 and price <= 20000 and popularity >= 25 and popularity <40:
image_label2.config(image=resized_bitcoin_medium)
bitcoin_condition.config(text="i am average right now")
elif price >= 21000 and price <= 40000 and popularity >= 45 and popularity <60:
image_label3.config(image=resized_bitcoin_above_average)
bitcoin_condition.config(text="i am above average right now")
else:
# update image and label to content
bitcoin_condition.config(text="I'm content...")
image_label1.config(image=resized_bitcoin_high)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|