Android Parallax Animation - animation

Requirements: Honeycomb 3.1, Galaxy Tab 10.1
I'm working on a project that requires Parallax animation in the transition from one element to another, the elements are in a component similar to the Gallery and what I need is when the user swipes over the screen to navigate to the different groups, the elements on these groups are animated with a parallax approach.
I have tested with the basic animation approach animating the bitmaps but it's slow so currently I am testing with SurfaceView.
What do you think is the best approach to achieve this?

If you try JetBoy which comes with Android SDK, you can see the quality of a paralax bitmap scrolling on SurfaceView. I find that smooth scrolling of huge sprites and background looks of course smoother with openGL.

Related

Issues with animating UI in different aspect ratio in unity

I am struggling with animating the Unity UI. It's just a simple slide up menu I have animated via the anchored position. The problem comes when the aspect ratio is changed, it will often end up completely offscreen instead of stopping in the intended position.

Optimal Fade In and Out of NSView

I am currently writing a presentation application showing images and video, full screen on multiple monitors. The images and video display one after the other and fade in an out.
At the moment I have this working correct but fades are not smooth, there is a little stutter.
My code currently animates the alpha on each of the components being shown.
[[self.videoView animator] setAlphaValue:1.0f];
Are there ways of doing this that will improve performance on OSX?
For example, when using cocos2D on iPhone it is more efficient to fade a colour layer up and down over the content, than in is to fade the content itself (i.e. animate the alpha on the most simple component). However, I can't see anything in Cocoa that would allow it to simplify the calculations it is doing (i.e. no simple concept of flat-color layer).
I hope that's clear! Thank you.
Making all the NSViews in the hierarchy layer backed makes a huge improvement to the performance of these transitions.
[self setWantsLayer:YES];

WP7 equivalent of Android 9-patch or iOS UIImage rightCapWidth?

I'm working on a WP7 app and can't find any way to stretch an image only at a specific point (repeating that row of pixels). For example, if I have a box with rounded corners I want to stretch it to fill a specific area only I want to stretch just a few pixels in the center (horizontally and vertically) so that the corners are unmodified.
In Android you can do this with a 9 Patch image and in iOS UIImage provides methods such as rightCapWidth.
What's the equivalent for WP7?
Thanks.
There is, currently, no direct equivalent for WP7.
You'll have to adjust the image as you need to for your requirements.
As applying rounded corners to everything doesn't match the Metro design principals for the phone, I expect there is little reason for, or likelihood of, such functionlaity becoming part of the core APIs.

How does UIScrollView like scrolling work?

in my opinion the iPhone has a big advantage to other smartphones because of its intuitive, smooth and good feeling scrolling components in UIKit. I want to implement a simple game with UIKit which uses this kind of scrolling, but i can't use UIScrollView because it isn't customizable enough.
I tried to implement this scrolling myself and tried two different approaches:
I used a UIPanGestureRecognizer und moved the bounds of my custom control according to the translation the recognizer delivers me. In order to get this smooth scrolling after lifting my finger during the movement I start an animation. I use the velocity the recognizer gives me and a fixed time in order to calculate how far it should scroll after I lifted my finger. I tryed a linear movement and a ease-out movement, but both looks strange. (more later on that)
I use OnTouchMoved and OnTouchEnded to implement the scrolling. In OnTouchMove I move the bounds according to the movment of the finger. While the finger moves I calculate the difference in location and time of the current and last touch in order to calculate a velocity myself. When the finger lifts I start an animation in OnTouchEnded like in 1. but I use my self-calculated velocity instead.
Both approaches are not giving me the results I want. After lifting my finger, the scrolling is not smoothly continued. There seems to be a (sharp) bend in the celocity curve.
Has anyone an idea how apple does this smooth scrolling? My current guess is that my interpolation with two really close points is to inaccurate and doesn't take the current acceleration into account.
Thx for your thoughts!
Kie
Why don't you add a UIScrollView as handle on top of your view, without visible content. Then you can use the UIScrollViewDelegate methods to update your real view on certain actions. For example: if you capture the scrolling of the UIScrollView using scrollViewDidScroll: , you can update your visible view with the offset of the scrollview. You can use the scrollViewWillEndDragging: to start synchronizing the main view with the scrollview, and scrollViewDidEndDecelerating to stop synchronizing.
I use the same approach to scroll the background of my Animix app. It has an invisible scrollview at the bottom, to give the user the feeling he can drag the grass to the left and right to move the background.

Canvas versus SVG animations (effects[filters] and performance)

I am developing an application that should run equally smoothly on a web browser (IE support completely optional) and on iPhones and have tested various libraries for days, including: jQuery SVG, CAKE (Canvas Animation Kit Experiment), Burst Engine, Processing.js and Raphael, and have yet to find the right one for this experiment.
The input is optional - whether an SVG or a PNG rendered from the vector, the only two requirements for the animation library are to be able to animate (rotate) the image, and gradually apply a blur filter or a "trails"-like effect.
Should I go for SVG or Canvas, performance- and the forementioned effectswise?
Previously the project was in Flash, but regarding the trends and lack of iPhone support, I decided to switch to a more progressive software.
Here you can compare filter performance svg vs canvas yourself. Another example shows how to do an svg 3d lighting effect vs canvas 3d lighting effect
There are many nice demos over at chromeexperiments showing both canvas and svg. And there's svg-wow.org which does the same more or less.

Resources