私はSOに固執していて、今は本当に必死になっています。私たちはgraphics.pyライブラリを使ってミニプログラムを作成しなければなりません。基本的に私が知りたいのは、どうやってスタートメニューのようにすることができるのか、そして、ユーザーがクリックすると、基本的に 'ゲーム'の別のフレームに変わります。フレームを変更しても、Zelleのgraphics.pyを使って同じウィンドウを使用していますか?
私の友人は.undraw()
機能を使用して提案したが、私はイムは、タイトル&小見出しを取り除くしようとしているとしても、単に空の文字列に.setText("")
を変更するテキスト&のために働くことと思ういけない...これは私のコードは次のとおりです。
from graphics import *
# create the window to hold the contents
win = GraphWin("SHAPES FRENZY", 800, 500)
win.setBackground("Black")
#Setting the Title Page:
title=Text(Point(400,250),"Shapes Frenzy.")
title.draw(win)
#Subheading
subheading=Text(Point(400,290), "Click anywhere to continue.")
subheading.draw(win)
#Next Frame
clickPoint = win.getMouse()
if clickPoint == True:
title.undraw() #THIS DOESNT WORK.
subheading.undraw()
#Setting up Second frame of program.
hi=Text(Point(500,250),"Please Work.")
hi.setFace('courier')
hi.draw(win)
win.getMouse() # Pause to view result
win.close() # Close window when done
あなたはちょうど私の人生を保存しました!!!ありがとうありがとう!!!!!!!!はい、説明してください!私は本当にそれを取得しません。 – Rita