Can I do Swipe Transition with CIImageAccumulator in IOS? - ios5

I have 2 images one is on top of another. the image on the top should disappear or appear if I roll iPad up/down. The effect should be like Swipe Transition effect.
To do this, if I redraw the top image every angle that the device is rolled, application is slow down and transition effect is not playing smoothly.
In the Core Image Programming Guide, I saw a topic for Imaging Dynamical Systems.
Is it useful for my situation?

Unfortunately CIImageAccumulator is not available in iOS 5 SDK (at least not in 5.1).
You can create your own CIFilter or use opengl shaders to make it faster.
Also, I think you don't need is to re-draw the image at every angle, people will barely notice it, you could draw every 5 or even 10 degrees according to your needs.

Related

Can it be done using UIAnimation?

I am developing a game for iPhone and I came across a question whether this can be done using UIAnimation or I have to switch to OpenGL.
If you see the picture above, you can realize there is a rectangle (it will have background image) having many holes in it. User is supposed to touch on holes and initiate the animation. The holes are actually on the image and are not some view. Do you know any article or tutorial I need to read in order to understand this can be done using UIAnimation?
It's more like chess. When you tap a hole, there is a view placed and moved at z-axis and then when you press the other hole, the view is moved to that hole and so on.
I believe it can be done with UIViews too. The holes can be made by using an image with "transparent" holes in it. You can place this UIView on top of a background image(if required). When touches are detected, you can animate another view on top of this view using addSubview:. You can keep this other view outside the screen bounds initially so that the animation seems like a sliding animation.
yes UIView is also an option in your case. if you feel that you will use high quality lots of graphic and will do lots of animation stuff at once on the screen, openGL will be the best or perhaps the gane you are making is a 2d game so you must consider COCOS2D "http://www.cocos2d-iphone.org/" for kick starting your game you'll surely get many effects and other glittering stuff with it. and bes of all it is openGL based..!! Performance will be too high for you..!!
Best of luck..!!

iPhone 4 circle creation on touch

How do you create filled flat circles (say white) that build out from each other in random overlap to fill the iPhone screen but ease-dissolve so that the screen never gets filled - on touch? On touch release they stop being created as they continue to ease transparency to 0 and are cleared from memory.
An example in code would be killer.
What you're doing shouldn't be too hard to do, but it would take some time to actually code. I'd be surprised but impressed if anyone were to make an example for you.
You could probably figure this out for yourself and learn some pretty good coding lessons on the way.
In order to do what you want, you need a pretty good handle on some concepts such as these:
(Cocos2d)
Touch Detection
Drawing Shapes
Random Numbers
Opacity
Timed Fade Animation (Your "Ease-Dissolve")
and utmost important:
**memory management!**

Big animation iPhone with CCSpriteFrameCache - plist

I have a problem when try to load the big animation with about 54 images (320x480 each image) into CCSpriteFrameCache, I can't use plist for this. How can I make the animation work? At this time, my animation can't work on iPhone 2G, 3G, and iPod.
Thank for your help,
John
You won´t be able to do it...
Consider playing a video or just animating an small portion of the screen.
Your best bet is to determine why the animation has 54 images that are all the width/height of the screen. This is an unnecessary number of images.
Break the animation down:
Is the background 'static' (does it move around, change constantly, etc?)
If it moves around a bit, but is really part of a much larger "canvas" then simply export out the entire background canvas and perform the movements yourself using the Cocos2D Actions available to you (CCMoveTo, CCJumpTo, CCDelayTime, CCSequence, etc)
What in the animation moves around, and how does it move around?
Can it be broken into much smaller bits and the frames for the various "characters"
or "movable objects" within the scene be exported out onto a sprite sheet (saved out
via Zwoptex?)
A good animation sequence should be a series of much smaller images, all working together in unison to create the final "animation sequence".
If you break it down, I wouldn't be surprised if you were able to reduce your 54 images at 320x480 each down to a handful of 512x512 spritesheets (ala Zwoptex).
If your having trouble breaking it down, I would be available to look at the final animation and help you determine what could be minimized to reduce the overhead.

Blinking UIView

For my iPhone app I'm creating some rotating gears with the help of some subclassed UIViews.
I have created subclasses that rotate themselves triggered by a timer.
In one place I have one of these subclasses within another one (so rotation within rotation, think moon rotation around earth and it's own axle). It all rotates fine and dandy, but sometime, like once or twice a minute, I see a very quick white blink in the area of the UIViews. Sometimes in the upper half, sometimes in the lower one and sometimes the whole area (which is only about 128 x 128 pixels).
I rotate by using CGAffineTransformMakeRotation.
I guessed it was due to performance problem, but after simplifying images (no more photoshop made drop shadows in PNG for example) and reducing the number per second the timer is called (2 times per second instead of 5) I still have the problem. CPU load is now down to between 9-25% (from around 47%) when measured in Instruments on a iPhone 3G. Still blinking!
Any clues on where to begin troubleshooting or any better way to rotate images within a view?
All ideas appreciated!
Basically I had an animation in an animation. Not technically skilled enough to say WHY that caused a problem, but removing the second animation solved the problem. My animations were of the type [UIView animateWithDuration... in which I did several CGAffineTransformMakeRotation's

Simulating graphing paper on iPhone

I need to implement 'graphing paper' in an iPhone app. The user should be presented with a grid. They user can touch individual squares to turn them on, or if they're already on, off.The user can pinch to zoom and scroll around the paper as well..
So far I'm thinking Quartz 2D + UIScrollView is the way to do this but these are both areas of iPhone development that I'm unfamiliar with. Does this seem like a reasonable strategy?
Yes, this would be the way to go. You could also create a UIView and give it a background color based off an image (+[UIColor colorWithPatternImage:]), but, myself, I'd go with option (a).