Comments (4)
Hi, thanks for this. Please can you include the image, fxml file and the minimal code that reproduces this issue so we can test and fix it as appropriate.
from fxgl.
Thank you for your reply.
Simply add the following code to the initUI method that extends the overrides of the GameApplication class to reproduce
protected void initUI() {
UI ui = getAssetLoader().loadUI("fxml/CitySubScene.fxml", () -> {});
getGameScene().addUI(ui);
}
Resource path of fxml assets/ui/fxml/CitySubScene.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.StackPane?>
<Pane xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1280.0">
<children>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1280.0">
<children>
<ImageView fitHeight="416.0" fitWidth="298.0" layoutX="61.0" layoutY="63.0">
<image>
<Image url="@CityDataWindow.png" />
</image>
</ImageView>
</children>
</AnchorPane>
</children>
</StackPane>
</Pane>
Resource path of IMageassets/ui/fxml/CityDataWindow.png
from fxgl.
@wendyunfa thanks for the clear examples, this should now be fixed by the attached commit.
Let me know if it works.
To get the latest build, you can use this:
<dependencies>
<dependency>
<groupId>com.github.almasb</groupId>
<artifactId>fxgl</artifactId>
<version>21+dev-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>oss.sonatype.org-snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
from fxgl.
Thank you very much. After testing, this problem has been fixed.
from fxgl.
Related Issues (20)
- MDIWindow custom buttons
- Best options for displaying a zoomable SVG image from within FXGL
- Allowing Save & Load of Timers
- How can we customize the UI elements created by the UIFactoryService & the DialogService
- Scene service subscenes
- Headless mode with no game app
- Extra loadUI() for asset loader that keeps its own JavaFX fx:controller
- .tmx file - read, modify at runtime and save it back ? HOT 3
- Getting excetion when setting selected language in LocalizationService HOT 2
- Provide implementation of EmbeddedPaneWindow::isFocused
- Refactor HandTrackingService to use WebAPIService
- Expand SpeechRecognitionService API to also include alternative text options
- Pooled entities do not parse data
- quantityProperty() in Inventory should be read-only to avoid external modifications
- Add RPCService test
- Implement QuestObjective expire duration HOT 1
- Cache 3D meshes where appropriate
- A new sandbox sample for physics-based simulations
- How to make use of internationalization when using menus HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fxgl.