前提・実現したいこと
ProcessingIDEを利用してPythonでゲームを作成しています。
そのなかの一番最初に表示される画面であるスタート画面を表示しようとしています。
発生している問題・エラーメッセージ
下記のコードのうちstartDisplay()内のforループ以下の
font = loadFont("Arial-Black-48.vlw") textFont(font) textAlign(CENTER) #参照座標を中心に fill("#225D1F") text("Awesome Game", width/2, height/3) #表示
この部分が実行されません。
該当のソースコード
Python
1def startDisplay(): 2 #背景の四角いの 3 margin_top_and_bottom = 100 4 quad_width, quad_top, quad_bottom = width/8, margin_top_and_bottom, height-margin_top_and_bottom 5 noStroke() 6 quad(quad_width, quad_top, quad_width + quad_width, quad_top, quad_width, quad_bottom, 0, quad_bottom) 7 for i in range(4): 8 translate(quad_width*2, 0) 9 quad(quad_width, quad_top, quad_width + quad_width, quad_top, quad_width, quad_bottom, 0, quad_bottom) 10 #:タイトル: 11 #フォントの指定 12 font = loadFont("Arial-Black-48.vlw") 13 textFont(font) 14 textAlign(CENTER) #参照座標を中心に 15 fill("#225D1F") 16 text("Awesome Game", width/2, height/3) #表示 17 18def setup(): 19 size(1000, 1000) 20 startDisplay() 21
試したこと
forループをコメントアウトしたところ正常に機能したのでイテレーションが原因だと思い、
・forループ内のコードをそのまま3回書いた
・該当部分とそれ以外の部分の関数を分けて実行した
等を試しましたが効果がありませんでした。
補足情報(FW/ツールのバージョンなど)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/02/24 07:40