teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

修正

2016/04/29 14:06

投稿

ywotnf
ywotnf

スコア16

title CHANGED
File without changes
body CHANGED
@@ -22,8 +22,9 @@
22
22
  </Label>
23
23
  </children>
24
24
  </AnchorPane>
25
+ ```
25
26
 
26
- ```
27
+ ```java
27
28
  import javafx.scene.input.KeyEvent;
28
29
  import javafx.scene.layout.AnchorPane;
29
30
 

1

追記

2016/04/29 14:06

投稿

ywotnf
ywotnf

スコア16

title CHANGED
File without changes
body CHANGED
@@ -1,6 +1,29 @@
1
- ```Java
1
+ ```xml
2
+ <?xml version="1.0" encoding="UTF-8"?>
2
3
 
4
+ <?import javafx.scene.effect.*?>
5
+ <?import javafx.scene.control.*?>
6
+ <?import javafx.scene.text.*?>
7
+ <?import javafx.scene.shape.*?>
8
+ <?import java.lang.*?>
9
+ <?import javafx.scene.layout.*?>
3
10
 
11
+ <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onKeyPressed="#KeyPress" onKeyReleased="#KeyRelease" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Game">
12
+ <children>
13
+ <Rectangle arcHeight="5.0" arcWidth="5.0" fill="#838383" height="400.0" layoutX="425.0" stroke="#838383" strokeType="INSIDE" width="175.0" />
14
+ <Rectangle arcHeight="5.0" arcWidth="5.0" height="400.0" stroke="BLACK" strokeType="INSIDE" width="425.0" />
15
+ <Label layoutX="486.0" layoutY="14.0" prefHeight="43.0" prefWidth="78.0" text="Score" textFill="#1b92e8">
16
+ <font>
17
+ <Font name="Lao UI Bold" size="29.0" />
18
+ </font>
19
+ <effect>
20
+ <Bloom />
21
+ </effect>
22
+ </Label>
23
+ </children>
24
+ </AnchorPane>
25
+
26
+ ```
4
27
  import javafx.scene.input.KeyEvent;
5
28
  import javafx.scene.layout.AnchorPane;
6
29
 
@@ -95,7 +118,7 @@
95
118
  Scene s = new Scene(pane);
96
119
  pane.requestFocus();
97
120
 
98
- Game g = new Gcont();
121
+ Game g = new Game
99
122
  g.GStart(pane);
100
123
 
101
124
  stage.setScene(s);
@@ -107,6 +130,7 @@
107
130
  }
108
131
  ```
109
132
 
133
+
110
134
  JavaFXを使ってゲームを作っているのですが、キーボード入力がうまくいきません。
111
135
  KeyPress()メソッドで変数が変更されているのにrun()メソッドでは変更されていません。
112
136