Advertisement
dmesticg

Untitled

Jun 5th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. restart_text = [500,20,100,50,"Restart",color(50,156,69)]
  2. pause_text = [500,70,100,50,"Pause",color(69,11,200)]
  3. throw_text = [270,450,100,50,"Throw",color(255,99,71)]
  4. score_text = [500,120,100,50,"Scores",color(0,191,255)]
  5. textboxes = [restart_text,pause_text,throw_text,score_text]
  6.  
  7. def drawtextboxes(textboxes):
  8. textSize(30)
  9. fill(255)
  10. for i in range(len(textboxes)):
  11. fill(textboxes[i][5])
  12. rect(textboxes[i][0],textboxes[i][1],textboxes[i][2],textboxes[i][3])
  13. fill(255)
  14. text(textboxes[i][4],textboxes[i][0],textboxes[i][1]+35)
  15.  
  16. def isClicked(info):
  17. clicked = False
  18. if mousePressed and mouseButton == LEFT:
  19. if info[0] < mouseX < info[0] + info[2] and info[1] < mouseY < info[1] + info[3]:
  20. clicked = True
  21. return clicked
  22.  
  23. drawtextboxes(textboxes)
  24. if isClicked(textboxes[2]):
  25. throw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement