EmeraldStudio
Android Fan
Profile
Posts: 3
Reg: Jul 15, 2012
Pitt Meadows
3,830
07/18/12 10:54 PM (13 years ago)

How do I....

Im working on a game, first one. The game isnt going to be animated and i want my back ground for the game to be larger then the screen and be able to move the view around the "map". Ive uploaded my image but it always wants to keep the ratio of the screen size.. Anyone that can point me in the right direction please.. Even if you know what this action is called so i can figure out the rest my self.... Thanks!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/18/12 11:26 PM (13 years ago)
iOS / Android? What kind of screen type are you working with? It's a matter of making the image "frame" larger than the screen. Making the image larger (and positioned "left and up" will help you get the image in the right spot to begin with. But, scrolling it around the screen is another issue altogether. How do you want to scroll it, user interaction or automatically? Either way you'll need to write some code to capture user events or some sort of automated routine to move the image around. I would start by... a) Getting the image set in the proper "start" position. b) Figuring out how to move it around (hundreds of strategies on moving images in game play). c) Writing the custom code to make it come alive. You'll end up writing lots of code to make this work. You can Google for most of it but only you will now how to get it working like you need.
 
EmeraldStudio
Android Fan
Profile
Posts: 3
Reg: Jul 15, 2012
Pitt Meadows
3,830
like
07/18/12 11:42 PM (13 years ago)
Its for Android and I want to make it movable by dragging your finger, im aware ill have to do allot of code and that's fine, its how I want to make it. Could you tell me what this action would be called? It would make it easier for me to research. Thanks
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/18/12 11:53 PM (13 years ago)
You want to do a few different things. Firstly, you'll need to create an onTouchListener to the ImageView object. Next, after capturing the touches, you'll want to use a Matrix to move the ImageView. Some simple examples here: http://stackoverflow.com/questions/1660150/move-imageview-around-inside-relativelayout After seeing that post, see if you can get your head around the concept of OnTouchListeners, you'll be doing lots of that when making games. Lastly: Please don't create threads titled "How do I..." Titles like this mean almost nothing and you'll have a hard time getting responses. Put some details in the title so folks know what you're asking. Like: "How do I move an image in Android"
 
ASusoeff
Aspiring developer
Profile
Posts: 296
Reg: Aug 13, 2011
Bryant, AR
13,460
like
07/19/12 07:31 AM (13 years ago)
Neat idea emeraldStudio...you have me now thinking about several new apps...let us know how you do once you get the code written and perhaps even do a tutorial on it. :-)
 
EmeraldStudio
Android Fan
Profile
Posts: 3
Reg: Jul 15, 2012
Pitt Meadows
3,830
like
07/19/12 04:57 PM (13 years ago)
Thanks Dave, ill do some research, pretty sure ill have that part set up soon, im not totally new to programming just new to java lol. Ill let you know how it goes. Thanks again..
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.