How do I do this?

All your problems with Audio, Video and Images.

How do I do this?

Postby Auburn » Wed Mar 09, 2011 2:26 am

I'm currently trying to add a background to my app. This background is "Unique" i would say and I have a few problems incorporating my idea. Basically I want to create a never ending/very large background kinda like the one for Angry Birds. Except this one goes on for MUCH further. I have a picture made I just need to make it very large.


An example i would say is this.
Heres the picture i have(ground) { _________________________} (the brackets are what the screen is showing at one point in time.

Heres what i want it to look like on the phone.{ ______________________}_________________________________

These brackets show the area at a point in time. However as you move right -------> the camera view moves with it.

If someone could help me with this that would be AWESOME, but if you cant i understand :) Thanks
Auburn
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Mar 09, 2011 2:10 am

Top

Re: How do I do this?

Postby gtang » Wed Mar 09, 2011 5:58 am

Try setting the layout's background to the photo or image you have in the xml file and try tinkering with the width and height pixels of your layout.
gtang
Junior Developer
Junior Developer
 
Posts: 12
Joined: Tue Mar 08, 2011 1:14 am

Re: How do I do this?

Postby Kerbik » Wed Mar 09, 2011 11:05 am

Hello,
Actualy I'm not very sure how large exactly do you need...

do you want make side-roller game? If yes isn't there any chance to loop background and make it large only on top?

You will make (xxxxx) large picture on width and cycle it to use it like

(xxxxx cycle to start xxxxx cycle to start xxxxx cycle to start.....)

in final your background will looks like (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
Kerbik.
Kerbik
Developer
Developer
 
Posts: 30
Joined: Fri May 28, 2010 6:06 am

Re: How do I do this?

Postby strider2023 » Fri Apr 01, 2011 8:48 am

Well what you can do is simple,

you already have defined the view area (screen size). Set your image at the devices origin. On button press move the image coordiantes based on the action

Example:

pos_x = 0; //origin
pos_y = 0; //origin

say on right pressed:

if (pos_x < image.width()) {
pos_x-=10;
}

then update the image position in your onDraw() function.
strider2023
Senior Developer
Senior Developer
 
Posts: 126
Joined: Tue Mar 02, 2010 6:34 am
Location: Chennai, India

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google [Bot] and 12 guests