Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Basically, I have a main menu, and I would like the background image to scroll (parallax I believe is the term? Like the Angry Bird's title screen background).

However, I'm used to just having a variable iterate (x++) and setting that as the x value so the image scrolls.

So is there any way to confer variables and such between xml and my java files so I can use iteration? Or can I skirt this completely somehow?

share|improve this question
    
It may actually be best I avoid xml sheets altogether and just do hard coding in Java, so I can implement "complex" effects like this. –  A13X Mar 10 '13 at 4:58

1 Answer 1

up vote 3 down vote accepted

You can check this example of mine which scrolls the background. But I would not recommended that you have widgets or views on top of a SurfaceView animations. AngryBirds I believe draws its own graphics interface as all good games do.

http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas/4946893#4946893

share|improve this answer
    
Yes I found a tutorial on making an interface so I can write Java classes instead of working with the GUI activity xml layout >.< –  A13X Mar 28 '13 at 1:47
    
+5 :)) Trying to learn how to do these things, I've read a ton of tutorials and code. Your example (StackOverflow link) stands out among the best. The code is simple, clean, and directly addresses several key issues. So on a meta-level, it is in itself an example of a great example. Content-wise, it's spot on because it shows both non-threading and threading on the one hand and view extensions versus surface views on the other - while throwing in the use of canvas and bitmap. All key factors in learning basic game graphics on Android. Kudos! –  Howard Pautz Oct 14 '13 at 16:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.