Loading Large Images

Hi!

I have about 24 images which is 1080x1920 which I use as background images on one scene(Background changes depending on player score) . My problem is that creating images on the fly results in lag, especially because they’re large. Loading them all at once eats up a lot of texture memory(Reaches about 200MB).

So my solution was to scale them down until 270x480. Loading them individually and on the fly still results in lag. So what I did was put them in a spritesheet. So what happens now is I load 3 of those spritesheets, create a sprite object the size of the screen, 1 is placed in the center of the screen, and the other 2 above it. The sprite obejcts(backgrounds) scroll down automatically, when the whole sprite obejct is off-screen, it returns to the top, above the last background and I change the current frame according to the player’s score.

Texture Memory now only reaches 25MB. This solved the lag problem. However though testing it in the actual device, the backgrounds were a bit pixelated, and for obvious reasons. I’m testing it on a Nexus 5 by the way. Creating a spritesheet with the original size 1080x1920 is just absurd, and texture memory would probably be too large if I load 3 of them. 

The only problem now is the pixelated backgrounds. Do you guys have any suggestions for this? Ideas? Workarounds? Or different approach?

Well, basically what I’m making is an endless jumping game, The background changes depending on the player’s score. That’s why I have those 24 large images. Do you know any other way of doing this?

@chasemoreli, please do not promote your apps outside of the app promotion forums.

Rob

Well, basically what I’m making is an endless jumping game, The background changes depending on the player’s score. That’s why I have those 24 large images. Do you know any other way of doing this?

@chasemoreli, please do not promote your apps outside of the app promotion forums.

Rob

Did you find a solution @Solji?

I´m also trying to figure out how to optimize my spritesheets. I´m trying to show a “short” video using sprite sheets (I don´t want to use native.newvideo or media.playvideo because I can´t place objects on top of the video).

But if I can´t use spritesheet to make a good, non pixelated video, I will have to reconsider native.newvideo :frowning:

@sirmania

Hi sorry for the super late reply, although I think you already have a solution I’ll still reply anyway. I was forced to scale each images down to about 320x480 if I remember it correctly and made a spritesheet for them. The images weren’t as pixelated as before and the texture memory isn’t as big as well. I suggest that you just scale the image down, but not so much. If that doesn’t work for you, might as well use the video method.

Did you find a solution @Solji?

I´m also trying to figure out how to optimize my spritesheets. I´m trying to show a “short” video using sprite sheets (I don´t want to use native.newvideo or media.playvideo because I can´t place objects on top of the video).

But if I can´t use spritesheet to make a good, non pixelated video, I will have to reconsider native.newvideo :frowning:

@sirmania

Hi sorry for the super late reply, although I think you already have a solution I’ll still reply anyway. I was forced to scale each images down to about 320x480 if I remember it correctly and made a spritesheet for them. The images weren’t as pixelated as before and the texture memory isn’t as big as well. I suggest that you just scale the image down, but not so much. If that doesn’t work for you, might as well use the video method.