Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BattleArena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Scherbaum Maximilian
BattleArena
Commits
1cd3b517
Commit
1cd3b517
authored
1 year ago
by
Scherbaum Maximilian
Browse files
Options
Downloads
Patches
Plain Diff
update GameScene.fxml, update GameSceneController.java
#2
parent
fd9d5217
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java
+41
-2
41 additions, 2 deletions
...stuttgart/battlearena/Controller/GameSceneController.java
src/main/resources/fxml/GameScene.fxml
+9
-1
9 additions, 1 deletion
src/main/resources/fxml/GameScene.fxml
with
50 additions
and
3 deletions
src/main/java/de/hdm_stuttgart/battlearena/Controller/GameSceneController.java
+
41
−
2
View file @
1cd3b517
package
de.hdm_stuttgart.battlearena.Controller
;
import
de.hdm_stuttgart.battlearena.Model.Inputs.InputHandler
;
import
javafx.animation.AnimationTimer
;
import
javafx.fxml.FXML
;
import
javafx.fxml.Initializable
;
import
javafx.scene.canvas.Canvas
;
import
javafx.scene.canvas.GraphicsContext
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.LogManager
;
public
class
GameSceneController
{
import
java.net.URL
;
import
java.util.ResourceBundle
;
public
class
GameSceneController
implements
Initializable
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
GameSceneController
.
class
);
}
@FXML
private
Canvas
canvas2D
;
private
GraphicsContext
graphicsContext2D
;
InputHandler
inputHandler
=
InputHandler
.
getInstance
();
@Override
public
void
initialize
(
URL
url
,
ResourceBundle
resourceBundle
)
{
graphicsContext2D
=
canvas2D
.
getGraphicsContext2D
();
AnimationTimer
gameLoop
=
new
AnimationTimer
()
{
@Override
public
void
handle
(
long
l
)
{
updateContent
();
renderContent
(
graphicsContext2D
);
}
};
}
private
void
updateContent
()
{
}
private
void
renderContent
(
GraphicsContext
graphicsContext
)
{
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/resources/fxml/GameScene.fxml
+
9
−
1
View file @
1cd3b517
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.canvas.Canvas?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.StackPane?>
<AnchorPane
prefHeight=
"400.0"
prefWidth=
"600.0"
xmlns=
"http://javafx.com/javafx/19"
xmlns:fx=
"http://javafx.com/fxml/1"
fx:controller=
"de.hdm_stuttgart.battlearena.Controller.GameSceneController"
>
<children>
<StackPane
prefHeight=
"400.0"
prefWidth=
"600.0"
AnchorPane.bottomAnchor=
"0.0"
AnchorPane.leftAnchor=
"0.0"
AnchorPane.rightAnchor=
"0.0"
AnchorPane.topAnchor=
"0.0"
>
<children>
<Canvas
fx:id=
"canvas2D"
height=
"400.0"
width=
"600.0"
/>
</children>
</StackPane>
</children>
</AnchorPane>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment