Navigating a view with Gyroscopes - iOS - iphone

i'm new to game developing so i might be a little confusing on defining what i need.
Assume i have a wide background picture, much bigger than the screen(e.g.4000*3000px), how should i approach if i want to navigate it with the input from the gyroscopes?
i mean handling the device up, down, left, right and so on.
If you remember the old Mosquitoes game on Symbian i would like to do something similar but without the camera.
However any suggestion is appreciated.
Thanks in advance.

Use UIScrollView - put your pic inside the scroll view and try to navigate with fingers.
When scroll will be working nice, use this or this or any other tutorial to find out how to use accelerometer.
Finally, when you will be able to collect data from accelerometer, give it to UIScrollView using [myScrollView scrollRectToVisible:myRect animated:YES];
All needed math and physics must be done by you.

Related

iPhone Word Game like Scrabble / Wordfued / Rummi

I am in process of creating a multiplayer game similar to the Scrabble / Wordfued / Rummi. I am trying to see what would be best way go about implementing the UI and their interactions.
I would be having a framework which would keep track of all the pieces on the board and the AI for knowing if it is a valid move.
I am trying to figure out what could be best solution to handle the UI part. The game board would be larger than would the current iPhone screen could support. So the board would have an effect of a scroll view. The same goes for the game tiles using which user can play. These are not fixed amount of tiles/cards and the same could be more in numbers which would also need another scroll view kind of effect.
There would be many more effect's were the user can move a complete set of tiles/cards from the board and place it in another location of the board. Or even a tile in between the set of tiles on the board.
So I am trying so see if I should go with two scroll view provided by iOS and handle all the detaching the tile/card from one scroll view and placing the same in GameBoard scroll view
Or
Should I go with something like cocos-2d which provides more advance game UI handling capabilities.
Please do let me know your thoughts and feedback on what could be the best choice for the same. Thanks in advance for all your help.
Words With Friends uses native UIKit views. It is quite simple and uses a transition to move between the two degrees of magnification (close up and not close up).
You can do everything quickly in UIKit with a UIScrollview. You can use drag events to move tiles around the screen, even changing their perspective/look during dragging. Using UIAnimation would allow you to do simple frame based animation for things like dropping a tile.
Cocos2d will be quicker if you already know a similar gaming library. However if you choose it you you'll miss out on using Interface Builder and a lot of conveniences in UIKit.
If you're starting from a base of zero with either approach, then only use Cocos2d if you want particle effects (like stars and sparkles, UIKit has nothing for this).
Otherwise I'd say try UIKit, it's easier and there are more resources on the web.

rotate uiview using touch (ipad and iphone)

I am trying to design another app and am struggling to think of the best way to do it. I'm after some advice please!
If you imaging a bicycle wheel in the middle of the ipad (and iPhone)... I want the user to be able to click on the tyre and spin it to the left or right. Depending on the speed of the swish will drive the speed of the wheel rotation.
It should rotate around the centre of the wheel and not move any other direction.
Do I need to use some graphics code, or simply listen for the touch, check the area they touched, then rotate the image around it's centre left or right?
Really I'm after some pointers around the methods to use - I'm not being lazy and asking for code, but if anyone knows of tutorials - that would help immensely!!
Thanks for any info.
Your best bet is to use one of the UIGestureRecognizer subclasses, probably UIPanGestureRecognizer as it includes velocity.
Apple's SimpleGestureRecognizers project will help you get started.

Making OpenFlow work vertically like a Rolodex

I've been looking at integrating the OpenFlow API developed by Alex Fajkowski: http://fajkowski.com/blog/2009/08/02/openflow-a-coverflow-api-replacement-for-the-iphone/ into an app I am working on.
Does anyone know how I can stack the images vertically so that I can scroll the images from top to bottom/bottom to top like a rolodex?
The default behaviour is for OpenFlow to stack the images horizontally and scroll the images from right to left/left to right just like CoverFlow. I've been trying to get my head around how 3D animation is done in Objective-C without much success...
Thank you for your help in advance.
The really easy thing to do is to rotate the whole view with something like this:
openFlowView.transform = (CGAffineTransform){0,1,-1,0,0,0};
You'll then have to un-rotate all the flowing views (or rotate the images, or whatever).
The better way is to fix OpenFlow, but without looking at its source code, it's not obvious what to change (mostly you should just need to swap "x" and "y").

How to get a 3D picture in an iphone app?

In an application, i saw that they used to display pictures of vehicles. But what was amazing was when we touch and swipe in that picture, it rotates in 3d way left and right. And from the front view we can rotate and get to see its back view also. It is a very good feature and i was trying to replicate it. But couldnt get an idea of how and where to start. My doubts are
Whats the actual format of the thing, it surely isn't a picture.
How do they get to rotate it?
Could someone give me an idea where i should start or where I should look upon?
Just like the KennyTM told you, OpenGL-ES is the weapon of choice. Take pictures of that object from all the sides you need to show, then use those as textures for the faces of the cube. Got the idea?

Iphone Scrollview Question

i am quit new at iphone development and trying to make a photo collage software while learning it. Right now i have a lil problem and hope you can help me out.
I have an UiviewController with a view in it, in this view i have 7 scrollviews with uiimagevies in them for zooming and scollign images within these scrollviews.
All that works well but now i want to make these 7 scrollviews dragable and maybe if possible zoomable (so that the image within the given scroolview zoom together with the scrollview).
It should be possible to drag them all around the screen and if possible even overlap them
and by the way rotating would be great ;-) hope that is not to much asked for.
Would be great if someone can help me out with this..
Well you've got to decide on some other choice here because the functionality you are asking for overlaps, and you can't ask the app to magically know which the user wants to do. What I mean by this is that when you touch and drag within a scroll view, it's going to try to scroll itself, rather than drag the entire scroll view around.
As for rotation and zooming - that gets more complicated, because you start dealing with vector math and the like. You can check out my question on rotation here. The link I gave you has the code to get both rotation and zooming to work.