This site requires JavaScript, please enable it in your browser!
Greenfoot back
Whymmy
Whymmy wrote ...

2017/11/5

Image causing Errors

Whymmy Whymmy

2017/11/5

#
So i'm trying to make a game as part of my class's final project. I've drawn my own background and tested with different images beforehand that show that a png image works as well as a jpeg to import as a world class image. Heres my problem. I go to import the background image file i'm going to use for the game, but it keeps pulling up an error message saying a java memory heap? It's really unnerving that it keeps giving me the error box no matter what i try to do. And i've done both the png and jpeg versions of the image.
danpost danpost

2017/11/5

#
You will need to show the code to your World subclass. Cannot help, otherwise. Also, what are the dimensions of the image you are trying to import? Sidenote: for a world background, a jpeg image is better because there cannot be any transparency in them (transpareny is not supported in .jpg) and you do not want any transparency in your world background image.
Whymmy Whymmy

2017/11/6

#
the dimensions are 5500 by 4125. I'm guessing that might be a bit big? but its a fairly large world that i want to make for my game. And what do you mean by show the code? like a screenshot? because the information is still the same for a before the picture was added, just a separate screen pops up with the java error in it. I can copy and paste that though.
danpost danpost

2017/11/6

#
Whymmy wrote...
the dimensions are 5500 by 4125.
That is a very extreme size. Most systems monitors have dimensions that about 1/5 that size -- meaning that the data usage for the background is about 1/25 (1/5 x 1/5) what you are using. Why such a huge world? See what you can do to reduce it.
Whymmy Whymmy

2017/11/6

#
I'm using medibang -a drawing app- to create the words, so i can easily resize the image to make it smaller and more easy to use. I kinda didn't realize the whole data usage part, or just like memory storage it might take for such a thing to load up. Thank you so much for the help. i'll try to resize the image and use it then and report back later possibly.
You need to login to post a reply.