canvas上にボタンを配置したいのですが、canvasの位置を調整したりして、いろいろ試しましたがうまくいきませんでした。以下のリンクで英語のボタンをcanvas上に配置したいです。200行目付近を書き換えると思うのですがよくわかりません。
どなたかお願いします。
リンク内容
JavaScript
1 // ボタン配置位置 2 var area = document.getElementById("sort_button_area"); 3 if (bi > 8) { 4 5 area.setAttribute("style", "text-align: center;"); 6 } else { 7 area.setAttribute("style", "text-align: center;"); 8 } 9 10 if(flg == 2) 11 { 12 document.getElementById('Problem').innerHTML = "解答:" + answers[current_number]; 13 document.getElementById('Correct').innerHTML = "正解:" + qarray1[random_number[current_number]].answer + ""; 14 } 15 }
質問内のコードで再現できるように配慮願います。
結局canvasにしたのでしょうか?
canvas上にインタラクティブな要素を埋め込んでも処理が大変なだけだと思いますが・・
「うまくいきませんでした」とのことですが、具体的には何がどのようにうまくいっていないのですか?
「こうなると思って」「このコードを書いたが」「この結果になった」
のように、想定・コード・結果をセットでご提示ください。
期待した処理結果を書きましょう
https://teratail.com/help/question-tips#questionTips3-4-3
エラーメッセージや実行ログをコピー&ペーストしましょう
https://teratail.com/help/question-tips#questionTips3-4-2
ソースコードを書きましょう
https://teratail.com/help/question-tips#questionTips3-5-1
結果(実際に起きたこと)を書きましょう
https://teratail.com/help/question-tips#questionTips3-4-1
回答2件
あなたの回答
tips
プレビュー