Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Tile #54

Closed
karishnu opened this issue Jun 7, 2018 · 2 comments
Closed

Image Tile #54

karishnu opened this issue Jun 7, 2018 · 2 comments

Comments

@karishnu
Copy link

karishnu commented Jun 7, 2018

I really needed a tile just to display images. The custom tie did not work for some reason.

@HanSolo
Copy link
Owner

HanSolo commented Jun 7, 2018

That's not a really detailled description of your problem. So I've created a TilesFXTest class in the test package which shows how to show an image by using the custom tile skin. In principle this is all you need:

 Image     img     = new Image(TilesFXTest.class.getResourceAsStream(YOUR_IMAGE"));
 ImageView imgView = new ImageView(img);

 Tile tile = TileBuilder.create()
                        .skinType(SkinType.CUSTOM)
                        .prefSize(750, 750)
                        .title("Image Tile")
                        .text("My Image")
                        .textVisible(true)
                        .graphic(imgView)
                        .build();

Here is a screenshot of the Tile with an image.
tilesfximg

@HanSolo HanSolo closed this as completed Jun 7, 2018
@karishnu
Copy link
Author

karishnu commented Jun 7, 2018

Thanks a lot for the detailed solution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants