I want to make an applications similar to Talking Tom Cat, Touch Pets Cats/, Virtual Monkey and the Tap Zoo.
I have knowledge of Iphone basic animation.
I want to know that can i make these apps without OpenGL ,cocos and other gaming environment...
Can i make it by using only basic frameworks...
Well if its related to talking tom then there is no OpenGLES Use... they are simply using images and animate them. using something like this -
aniImage = [[UIImageView alloc] init];
UIImage* opa1 = [UIImage imageNamed:#"o1.png"];
UIImage* opa2 = [UIImage imageNamed:#"o2.png"];
UIImage* opa3 = [UIImage imageNamed:#"o3.png"];
UIImage* opa4 = [UIImage imageNamed:#"o4.png"];
UIImage* opa5 = [UIImage imageNamed:#"o5.png"];
UIImage* opa6 = [UIImage imageNamed:#"o6.png"];
UIImage* opa7 = [UIImage imageNamed:#"o7.png"];
UIImage* opa8 = [UIImage imageNamed:#"o8.png"];
UIImage* opa9 = [UIImage imageNamed:#"o9.png"];
UIImage* opa10 = [UIImage imageNamed:#"o10.png"];
UIImage* opa11 = [UIImage imageNamed:#"o11.png"];
UIImage* opa12 = [UIImage imageNamed:#"o12.png"];
UIImage* opa13 = [UIImage imageNamed:#"o13.png"];
UIImage* opa14 = [UIImage imageNamed:#"o14.png"];
UIImage* opa15 = [UIImage imageNamed:#"o15.png"];
UIImage* opa16 = [UIImage imageNamed:#"o16.png"];
UIImage* opa17 = [UIImage imageNamed:#"o17.png"];
UIImage* opa18 = [UIImage imageNamed:#"o18.png"];
NSArray *imgsArr = [NSArray arrayWithObjects:opa1, opa2, opa3, opa4,
opa5, opa6, opa7, opa8, opa9, opa10, opa11, opa12, opa13, opa14, opa15, opa16, opa17, opa18, nil];
[aniImage setAnimationImages:imagesOpcaity];
[aniImage setAnimationRepeatCount:1.0];
[aniImage setAnimationDuration:0.2];
If you wants to see all the images they are using follow these setps -
1) buy the free version on your iPhone/iPad
2) transfer your purchases on your mac or windows.
3) then drag the ipa file from Library -> Apps to your desktop (just drag the app icon from iTunes to desktop)
4) rename the .ipa file to .zip file
5) extract this zip file.
6) you will get a folder named "Payload" in it.
7) open the .app file (it will open on windows automatically because it is a folder on windows, on mac right click on it and select show package content.
8) in the .app folder you will find a folder which contains all the images used by above function.
Hope it helps
There are 2 approaches
One - make them as 3d Models with animations. The best suited too for this is Unity3d (it brings down development time to a great extent) But the basic version for iPhone to publish costs 400$. I think its worth it.
Two - Make all of them as frame animations. Use either Cocos2d or UIImageView's frames to animate it. You need to dealloc and alloc on the fly when you have too many frames due to which you might hit memory warning. You might think loading on the fly would be costly/intensive but its not as much as you would expect, as iDevices have flash memory on them and we have tried this.
I personally would say use 2nd method if you need just a clone. But with 3d models with animations in them, you get more freedom to add creativity like a 3d camera to look around. So you can poke in the butt and have a different animation for it etc. Also you could have overlay texture and do things like adding tattoos to the 3d model.
You can make Tap Zoo and other by using images or sprite sheets may be on UIButton or enable user interaction for images. but you have to use alot of coding to implement some like that big, it wouldn't be difficult to accomplish it just many lines of code(seriously many more than 100K). So take my advise and learn cocoa2d or quartzcore2d or opengl that way you will not only learn something new but also be able to make nice games. for opengl start up follow this link
http://appstapnet.blogspot.in/2009/04/opengl-es-from-ground-up-part-1-basic.html?m=1
Related
I'm trying to download an image from the internet. I'm not sure why this code is not working when I want to get the photos with these specs (209x209 pixels,not more than 65KB).
Writing to iPhone directory:
NSData *imgAsData = [NSData dataWithContentsOfURL:imageURL];
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:imageURL]];
//UIImage *image = [UIImage imageWithData:[NSData thumnail_url]];
NSFileHandle* myFileHandle = [NSFileHandle fileHandleForWritingAtPath:self.product.img_url];
[myFileHandle writeData:UIImagePNGRepresentation(image)];
[myFileHandle closeFile];
I even tried writeToFile, but it still doesn't work.
[imgAsData writeToURL: [NSURL URLWithString:self.product.img_url] atomically:YES];
Reading from iPhone directory:
NSFileHandle* myFileHandle = [NSFileHandle fileHandleForReadingAtPath:self.product.img_url];
//NSFileHandle* myFileHandle = [NSFileHandle fileHandleForReadingAtPath:self.product.thumbnail_url];
UIImage* loadedImage = [UIImage imageWithData:[myFileHandle readDataToEndOfFile]];
I was using this code in the same app to download thumbnails and they are working (notice the commented out lines using the "thumbnail_url"). I tried to substitute the thumbnail url in the place of this "larger" image and it worked. I was able to save the thumbnail offline, but I need to get the larger version (since, of course, the thumbnails are too pixelated).
I'm sure that the paths are ok since I got the thumnails working.
I'm lost. Is this not working because the file size is "larger"? Help please, Thanks!
The problem is NSFileHandle fileHandleForWritingAtPath can not create a file. You need to create the file first.
To save images to iPhone simply use
UIImageWriteToSavedPhotosAlbum(<#UIImage *image#>, <#id completionTarget#>, <#SEL completionSelector#>, <#void *contextInfo#>)
If you want to save images only 209*209 then add a check before that on the dimension of an image. I don't know(yet) how to read the images from iPhone, but you can use UIImagePickerController to choose the images.
Hope it helps
In my app I've got a CCTexture2D, which I'm creating using an image, creating a sprite from the texture, then adding to the stage, like this:
UIImage* faceUIImage = [UIImage imageNamed:#"face.jpg"];
CCTexture2D* faceTest = [[CCTexture2D alloc] initWithImage:faceUIImage];
CCSprite* testSprite = [CCSprite spriteWithTexture:faceTest];
[self addChild:testSprite];
testSprite.position = CGPointMake(200, 100);
(I know this might seem a weird way to do it, but I'm doing some stuff to the pixel data elsewhere in the program, so I cant just use a pure sprite).
In the simulator, it looks fine:
However, when I run it on my iPhone (running 4.2), I get this:
Ignoring the fact that they are different orientations, how come the image on my device is in the background, and really dark? Can anyone help me with this?
Thanks,
Rich
Did you try :
[self addChild:testSprite z:1];
Eventually I fixed this simply by changing the jpg to a png instead... Maybe cocos2d doesnt really like jpg?
What is the best pattern for displaying images both on iOS3 and iOS4?
For example, here's code for a custom activity animation:
activityImageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:#"s01"],
[UIImage imageNamed:#"s02"],
[UIImage imageNamed:#"s03"],
[UIImage imageNamed:#"s04"],
[UIImage imageNamed:#"s05"],
nil];
On low-res and high-res devices running iOS4, the images load as expected. On iOS3 the images cannot be found since the .png extension is seen as missing.
What's the right way to deal with this situation? Do I need to throw hacky conditionals throughout my code or is there a cleaner method?
Is something from Matt Gallagher's article a good approach?
http://cocoawithlove.com/2010/07/tips-tricks-for-conditional-ios3-ios32.html
You still get the auto '#2x' loading behavior in iOS4 even if you use the file extension, so [UIImage imageNamed:#"so1.png"] is fine (it will find "so1#2x.png" if you're running on a Retina Display with OS 4) plus it's backwards compatible with 3, where it will always find the low-res version of the file.
See the "Loading Images into Your Application" section here.
How do I save a MapView to the PhotoAlbum for later attachment to an email created within my iPhone application?
Try this:
UIGraphicsBeginImageContext(map.layer.bounds.size);
[map.layer renderInContext:UIGraphicxGetCurrentContext()];
UIImage *mapImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
And perhaps you should also double-check Google's licensing terms if they allow making and distributing screenshots of the maps.
I know that there is an MPMoviePlayerController present in iPhone to play movies from. But it isn't customizable in the real sense. Also, if I wanted to play movies is a non-full screen mode, it isn't possible today.
I wanted to inquire if anyone knows about the future roadmap of iPhone SDK, is there going to be any such customizable video player upcoming?
Also, is it possible to write a new video player from scratch (maybe including the codecs), then in that case which part of the SDK should be referred to and how?
Some help in this area will be really appreciated.
Thanks,
Saurabh
I don't know of anything in the future about a customizable video player. However, if there are just a few videos you want to play in non-fullscreen mode, there is an option. UIImageView supports animation. So, if you can export your videos as images, you can have them display in an UIImageView.
For example,
//load your images here
youImageView.animationImages = [NSArray arrayWithObjects:[UIImage imageNamed:#"1.png"],
[UIImage imageNamed:#"2.png"],
[UIImage imageNamed:#"3.png"],
[UIImage imageNamed:#"4.png"],
[UIImage imageNamed:#"5.png"],
youImageView.animationDuration = 1; //this is the duration of the animation and can be any value
[youImageView startAnimating];
This blog post http://www.nightirion.com/2010/01/scaling-a-movie-on-the-iphone/ mentions a method that will allow you to play non-fullscreen video. However, I'm not sure if this method will be approved by the app store verification process.