Implemented custom cursor

This commit is contained in:
2026-06-22 09:10:17 +02:00
parent 4298cf333a
commit a618e43f4f
2 changed files with 19 additions and 0 deletions
+18
View File
@@ -1,13 +1,31 @@
package project; package project;
import pi.Controller; import pi.Controller;
import project.scenes.LoadingScene; import project.scenes.LoadingScene;
import java.awt.Cursor;
import java.awt.Point;
import java.awt.Toolkit;
import java.io.File;
import javax.imageio.ImageIO;
public class Main public class Main
{ {
public static void main(String[] args) public static void main(String[] args)
{ {
Controller.instantMode(false); Controller.instantMode(false);
Controller.start(new LoadingScene(), 1000, 600); Controller.start(new LoadingScene(), 1000, 600);
try {
Cursor customCursor = Toolkit.getDefaultToolkit().createCustomCursor(
Controller.images.get("images/pixui-pack/Misc/Cursor.png"),
new Point(0, 0), // Hotspot (Klickpunkt)
"PixUI cursor"
);
Controller.frame().setCursor(customCursor);
} catch (Exception e) {
e.printStackTrace();
}
} }
} }
@@ -16,6 +16,7 @@ public class LoadingScene extends Scene
private Image tatli; private Image tatli;
public LoadingScene() { public LoadingScene() {
title = new Text("Royal Kebab"); title = new Text("Royal Kebab");
subtitle_content = "Loading"; subtitle_content = "Loading";
subtitle = new Text(subtitle_content); subtitle = new Text(subtitle_content);