Panning around center view in iOS - iphone

This is a bit of a continuation of my last question, but I'm at a loss as to how I should approach this. I have a center view that is dynamic and changed via three options panels. An example of this is shown here:
http://i.imgur.com/um9tr5X.gif
I realize that I should be using the Pan Gesture to move it around, but I'm new to xCode and a bit lost with how to add the momentum and snap to the views. I considered using paging in a scrollview to achieve the effect, but I'm not sure I'll be able to do that.
I would really appreciate a bit of a kickstart in the direction I should be going.
Thanks.

You can search for open source control which other developers has developed if you are new to xcode.
Try this one:
https://github.com/MarcoSero/MSMatrixController
This is something similar to what you want. You will need little modification here to achieve your desired look.
Thanks!

Related

Swift Slamming Logo Animation

I am creating an application in Swift, and I would like to make an introduction screen that shows off my logo. I want the logo to slam down on the screen, which will then cause a crack, and then that crack slowly grows. I think I can figure out slamming the logo down (by shrinking a UIView of my logo to a certain point), but I am having trouble deciding how to create the crack that will form from slapping down. Do I use views? I am lost.
This is the closest thing that I found to what I would like to do. Sadly, I do not have this software.
https://www.youtube.com/watch?v=bh2y0Xs4IWA
I have created a similar effect before. And to achieve the crack a created multiple images of a growing crack and created an array of images for that screen crack. All you have to do then is animate the images if the imageView.
The other way you can Handel this is to actually draw the crack your self by code which is not difficult really, because in reality it’s just lines and then animate them. But in my experience just using the first method gives a much nicer effect because the images you use can have tons of effects using PS or equivalent.
I would suggest to go with third party like lottie. In lottie files there some animation you except there, you can also message the designer to help out animation. Its very simple to use in swift.
https://www.lottiefiles.com/
you can also check out my profile:
https://www.lottiefiles.com/parameshvadivel
Lottie animation are done in aftereffects using bodymoving extension and exported as json file to use in xcode.

Navigating a view with Gyroscopes - iOS

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.

Cocos2D camera movement?

What is the best way I center the screen to follow the character? Should I use CCCamera or just move the background around?
I am new to cocos2d so please show me exact code.
BTW: I am also using box2d in this project.
Thanks
Try this...
[self runAction:[CCFollow actionWithTarget:(your hero) worldBoundary:CGRectMake(0,0,1050,350)]];
It will follow your character (your hero).
Hey there,
You have always to choose between the best way and the best way in your situation. A problem has multiple ways how you can solve it. So I can just tell you how I did it.
A few weeks ago I released my first game. (If you are interested check it out: Birdy!) I also used Cocos2d and had the same problem like you. The player should always be in the center of the screen. I've choosen the way to move the background. I added 2 things to the GameScene: The background and the bird. And I set the background as the bird's delegate. So as soon as the bird performs a jump for example, the background is moved in the opposite direction.
I think for my situation it was the best method. But I can't talk about CCCamera because I never did anything with that class...
I hope I could help you a little bit. But it's always a bit difficult to find the right way. So you should also think about things you will optionally add in the future. So perhaps my way does not fit your requirements...
I hope also my english is understandable...
Sandro Meier

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").

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.