我需要一个图形窗口,当用户单击一个按钮时,它会一遍又一遍地显示一条消息。我已经在互联网上查看了有关如何不使其重叠的说明。这很可能是一个快速修复,但 idk。请帮助这里是我的代码。我正在尝试制作一个答题器游戏,但随着这个问题的发生而被拖走。
GraphicsWindow.Height = 420
GraphicsWindow.Width = 720
GraphicsWindow.CanResize = "1"
button = Controls.AddButton("Click for eggs",200,200)
Controls.SetSize(button,100,100)
eggs = 0
Controls.ButtonClicked = buttonClicked
Sub buttonClicked
lastButtonClicked = Controls.LastClickedButton
If lastButtonClicked = button Then
eggs = eggs + 1
GraphicsWindow.DrawText(0,0,"You have " + eggs + " eggs")
ElseIf eggs >= 1 Then
GraphicsWindow.BackgroundColor = "White"
GraphicsWindow.DrawText(0,0,"You have " + eggs + " eggs")
EndIf
EndSub