iPhone: An UI question - iphone

I want to implement an UI which should look like Speedometer. Is there a way to implement like that? Some of apps i seen that they have implemented. For ex. an app called "TaxCaster" implemented it. Could someone help me how can i achieve it?
Thank you in Advance.

That is possible yes, but it will not be easy. You will have to either use OpenGL or Core Animation. I would suggest the latter if you want something like they have in TaxCaster.
You can find more about Core Animation here.
I hope it helps.

A possibility is to simply have two UIImageViews:
A background that has all the measurement listings (i.e. the ruler part), and another that would act as your needle, pointing to the current measurement. All you would need to do when changing the current measurement would be to use the transform property to rotate it into the correct position.
Not a trivial amount of work, but it shouldn't be too hard.

Related

Scoring scale object

I started working with Unity platform just a few days ago. I want to create and object like this one: (http://www.bankingsense.com/wp-content/uploads/2014/09/credit-score-ratings.png) where the user will choose the appropriate answer. Each option will generate a different score that should be stored for later use.
Can anyone give me some tips ad guidelines to this?
Thank you very much!
VĂ¢nia
this is very simple. use one image as the scale background. use another image as the pointer. set the pivot and anchor of the pointer at the position where you want to rotate it. use transform.Rotate() in your code to rotate the pointer.

Is this animation possible on an iPhone/iPodTouch?

Is this sort of animation possible on an iPhone/iPodTouch? If yes, would it cause the app to slow down to a crawl?: an animated character would "liquefy" (become like a liquid--liquid mercury, etc.) and flow about the screen, in between and around the various buttons and field areas. Thanks.
That sounds far outside the scope of Core Animation. You'd have to use OpenGL for something with that level of complexity--but yes, I do believe that's within the hardware's capabilities (depending on exactly what you mean.) Take a look at games like Infinity Blade or Rage to see what an iPhone's hardware is capable of.
Not with any standard protocols. You could probably work up some totally custom thing but it would not be a trivial task.

how to add a repeating background in cocos2d

I am new in iphone and as well in cocos2d
I have some queries about a game i am working on it.
Actually i have a background with some trees and bushes.and i have an object which keeps on moving and my background of trees and bushes is static at the back. I want the application to repeat the background and it give me a look that my object is moving forward.
Can anybody Guide me please.
I also want to implement speed so also guide me that how can i change the speed of background repetition. so that it gives a look that my object is slow or fast
Thanks
waiting for your positive response.
Regards
sHaH
Work through this excellent tutorial:
http://www.raywenderlich.com/3857/how-to-create-dynamic-textures-with-ccrendertexture
It'll surely help you.
The section "Repeating Backgrounds" explains how to make a texture repeat and animate it.
In order to change the speed you can make PIXELS_PER_SECOND a dynamic variable.

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

how to make a Kaleidoscope in iPhone

i am trying to make a Kaleidoscope app in iPhone.
Some one can tell me how can make it, what kind of techs i must use, please !
thanks a lot for your helps, i am so worried now !
Thanks
To generate a random background and then do the two mirror reflections, you will need CoreGraphics/Quartz, and know about layers, and CGContexts. In order to vary the background based on the movement of the iPhone, you need to learn how to read the accelerometer.
This is if you want to make it look similar to a real Kaleidoscope. Otherwise you could take the much simpler approach of creating a graphic formulaicly based on random data that is then cropped to a pie slice and repeated twice to create a simple Kaleidoscope graphic.