Want the word Rock
to show up centered in front of the pre-existing clickable square, but can't figure it out because the text stays behind the box. I can't find an answer for this anywhere.
def rockClick(x, y):
if Rock.color()[0] == 'white':
Rock.color('black', 'white')
else:
Rock.color('white', 'black')
#Rock
Rock = turtle.Turtle()
Rock.speed(0)
Rock.shape('square')
Rock.color('white', 'black')
Rock.penup()
Rock.shapesize(stretch_wid=7, stretch_len=7, outline=5)
Rock.goto(-230,-240)
Rock.onclick(rockClick)
playerChoice = 'Rock'
Rock.onrelease(rockClick)
#Rocktext
rockText = turtle.Turtle
rockText.speed(0)
rockText.color('white')
rockText.penup()
rockText.hideturtle()
rockText.goto(-380, -280)
rockText.write('Rock', align='center', font=('Courier', 24, 'bold'))
Tried placing the rockText
turtle before the clickable squares creation, afterwards, in the main game loop. Tried having the rockText
as a stamp but I got an error from that. I'm at a loss for solutions as even the solutions to Potatoezzz's similar question didn't work.