Touching an object in a tweened animation?

by Michael » Fri, 23 Apr 2010 02:59:30 GMT


Sponsored Links
 I'm having trouble porting a simple game I developed for the iPhone
over to Android. The game has an animated ball which moves from Point
A to Point B. The user must touch the ball before it reaches point B
or lose the game. This was easy to implement on the iPhone using Core
Animation since I could locate the current position of the ball by
accessing its animation layer. In Android, I attempted to recreate the
game using tweened animation and represented the ball as a Drawable.
My issue is that I can't determine if the user is touching the spot
because the Drawable apparently bounds do not update as the ball
visually moves - making the program think the ball is always in its
original position. While searching these forums I saw an Android team
dev. confirm that you can't get the current location in a tweened
animation but offered no solution for a workaround. Can I accomplish
this on the Android using my current approach? If not, what approach
should I use?

Best regards,
Michael

--



Other Threads

1. android eclipse plugin logcat font preference bug

Does anyone else get this when trying to set the logcat font with the
new 2.3 SDK?

Error notifying a preference change listener. Check the log for
details.
[Lorg.eclipse.swt.graphics.FontData; cannot be cast to java.lang.String

-- 

2. eglSwapInterval not exposed

Hi,

i was curious to see whether the vsynch that is default on all devices
is actually a hardware limitation of a software limitation. For this i
first tried to get EGL_MIN_SWAP_INTERVAL. Neither EGL10 nor EGL11
expose that constant. Fair enough, the official EGL headers show me
the constant value. I was surprised to find that my Hero has a
EGL_MIN_SWAP_INTERVAL of 0. So you could in fact disable vsynch.

For that you need eglSwapInterval. Only problem is that it's not
exposed in the Java interface. It is however in the latest r5 release
of the NDK, the first one to expose EGL functionality on the native
side of things. Is there any way to backport this to to native code
for say a 1.5 device? Or a 2.1 device?

I know that turning of vsynch is probably a bad idea on a battery
powered device. But i'd still like to have complete control if at all
possible. The LG Star (Optimus 2X) featuring that shiny Tegra chip
seems to have vsynch disabled by default, running at higher framerates
than the display is capable of handling (a lot more than 60Hz).

Ciao,
Mario

-- 

3. [WTS]Acer Liquid

4. backflip

5. Does froyo support 3G usb serial?

6. Nexus S -- meet singels in your area -- WTF? (annoying ads)

7. build launcher