It's not a secret anymore!
The moose likes JavaFX and the fly likes Image issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Image issues" Watch "Image issues" New topic

Image issues

Philip Vaughn

Joined: Jan 04, 2014
Posts: 6
Hi! My name is Phil and I'm new to these forums.

I have an issue that has been bugging me a couple of days. First, let me be clear about what I'm trying to do. I am building an RPG style game and have a map class that extends an FX Pane.

I am trying to have animated water. I have about 72 farely large png files created with Adobe After Effects that are the animated water image files. They are about 1200 x 1200 pixels. At first I just tried popping these in an ImageView by calling
myImageView.setImage(my water name); but the program freaks out and crashes. I'm guessing because the files are so large and I'm setting the image every 100 millis (10 frames a second basically). I need a better way to do this obviously.

Any suggestions? I'm not above using a different method (ie. not using ImageView) if necessary. I'm not a beginner programmer by any means so feel free to leave me code if you want. I'm more familiar with ruby though

Anyways thanks for any help.
Dennis Grimbergen
Ranch Hand

Joined: Nov 04, 2009
Posts: 159

Hi Phil,

Welcome here :-)

The first idea that came to my mind: Do you reload these 72 images every 100 millisec? If so, then it would explain why your program freaks out.

Philip Vaughn

Joined: Jan 04, 2014
Posts: 6
I basically only load one image every 10 frames but I actually figured it out. I was double looping my update on accident. I was calling that update from a global class (class made just for updates) and I also called an infinite cycle count in the update that was changing the image view so it was multi updating each time it ran. I've since fixed it though. It had me stumped for a while though. I'm going to stick around this site though and see what all I can do to help/learn.
I agree. Here's the link:
subject: Image issues
It's not a secret anymore!