I everyone
I tried to do this months ago but I took a break and now I am back attempting it once again.
I am learning android and java, I bought hello android and java jeffs book (both great books) and I know livewallpapers are more advanced then I actually should be trying be trying right now but I did a test trying rescaling using onSizeChange to get the height and it worked perfect, next I tried it in a livewallpaper but using onSurfaceChanged to get the height to use for my rescaler number but this time no go.
I am using the aquarium livewallpaper tutorial to try this as a test, I put all the classes in one file and used inner classes instead (for me I like it better)
Here is what I am trying to.
First get the screen height
Next get the background image height (which will always be bigger)
then (screenHeight / backgroundImageHeight) gives me a rescale number I can use to rescale every image
after this I get the image height and width I want to rescale and do this
rescale * imageHeight , rescale * imageWidth to rescale them with.
Here is the full huge page code I tried that did not work.
The rescaling is done in the SpriteAnimationActivityEngine class inner one is public void onSurfaceChanged
and in the Inner Class public class TheTemplate
That is the only two places I tried this code so far, just to save you from reading it all I will only add those two parts of the code unless you need more
I marked comments where I made the changes to try and get it to rescale to make it easier to sort through it all.
I don't know what I did wrong and am looking for help in this.
It did work perfectly using the onSizeChange height but not this time.
Any help would be greatly appreciated
Thanks in advance
Sam
EDIT ok I tried another way using DisplayMetrics to get the screen height and did it all within the theTemplate class just to see if it would rescale this way in case I did something wrong passing arguments from class to class, b ut it still don't rescale it. Still scratching my head on this one.
Heres the code
Again any help would appreciated
Thanks again in advance
Sam
I tried to do this months ago but I took a break and now I am back attempting it once again.
I am learning android and java, I bought hello android and java jeffs book (both great books) and I know livewallpapers are more advanced then I actually should be trying be trying right now but I did a test trying rescaling using onSizeChange to get the height and it worked perfect, next I tried it in a livewallpaper but using onSurfaceChanged to get the height to use for my rescaler number but this time no go.
I am using the aquarium livewallpaper tutorial to try this as a test, I put all the classes in one file and used inner classes instead (for me I like it better)
Here is what I am trying to.
First get the screen height
Next get the background image height (which will always be bigger)
then (screenHeight / backgroundImageHeight) gives me a rescale number I can use to rescale every image
after this I get the image height and width I want to rescale and do this
rescale * imageHeight , rescale * imageWidth to rescale them with.
Here is the full huge page code I tried that did not work.
The rescaling is done in the SpriteAnimationActivityEngine class inner one is public void onSurfaceChanged
and in the Inner Class public class TheTemplate
That is the only two places I tried this code so far, just to save you from reading it all I will only add those two parts of the code unless you need more
I marked comments where I made the changes to try and get it to rescale to make it easier to sort through it all.
I don't know what I did wrong and am looking for help in this.
It did work perfectly using the onSizeChange height but not this time.
Any help would be greatly appreciated
Thanks in advance
Sam
EDIT ok I tried another way using DisplayMetrics to get the screen height and did it all within the theTemplate class just to see if it would rescale this way in case I did something wrong passing arguments from class to class, b ut it still don't rescale it. Still scratching my head on this one.
Heres the code
Again any help would appreciated
Thanks again in advance
Sam