Hello everyone. I want to make a splash screen for my game. I need the image to fit the screen's width but I want the height to be larger than the screen's. Than, I will have an animation moving the image vertically, hiding the top part and showing the bottom one.
I have searched a lot and I am more puzzled now on how I should do this.
Firstly the only solution I found for the fitting part was a combination of java and xml. But the problem here is that the java class doesn't produce a bigger than the screen image, but a cropped image. So, I can't make the animation later on.
Than i figured out that I could use a scrollview. And after combining some solutions I found on the web, I managed to have the right dimensions for my image and avoid any cropping. But now I can't do the animation because I am using the "fromYDelta ... toYDelta" and I can't find a way to calculate how much to put in the "toYDelta" value. And it cannot be a fixed value because every screen is different and so the dimensions of my splash screen.
Can anyone tell me a way to do this? Should I do it only in java and don't use xml at all? Or is it possible to do this through xml only (which would be better I think)?
I have searched a lot and I am more puzzled now on how I should do this.
Firstly the only solution I found for the fitting part was a combination of java and xml. But the problem here is that the java class doesn't produce a bigger than the screen image, but a cropped image. So, I can't make the animation later on.
Than i figured out that I could use a scrollview. And after combining some solutions I found on the web, I managed to have the right dimensions for my image and avoid any cropping. But now I can't do the animation because I am using the "fromYDelta ... toYDelta" and I can't find a way to calculate how much to put in the "toYDelta" value. And it cannot be a fixed value because every screen is different and so the dimensions of my splash screen.
Can anyone tell me a way to do this? Should I do it only in java and don't use xml at all? Or is it possible to do this through xml only (which would be better I think)?
Aucun commentaire:
Enregistrer un commentaire