So It should work for you.
But maybe we do not talk about the same topic...
I mean this:

Uploaded with ImageShack.us
The dolphin swims from one screen to the next screen.

knaikos wrote:Hi!
But now, I'm trying to add an extra funcionality: I have a moving sprite on the screen and I want to trigger an event when the sprite is touched.
My first thought was to use the OnTap Method (from the BaseLiveWallpaperService class):Using java Syntax Highlighting
protected void onTap(final int pX, final int pY) { } Parsed in 0.035 seconds, using GeSHi 1.0.8.4
Although it seems to be the easiest way, it doesn't work because the method is never called.
Then I tried to solve it using the TouchDragExample (included in the andengine example) :Using java Syntax Highlighting
final Sprite face = new Sprite(centerX, centerY, this.mFaceTextureRegion) { @Override public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) { this.setPosition(pSceneTouchEvent.getX() - this.getWidth() / 2, pSceneTouchEvent.getY() - this.getHeight() / 2); return true; } Parsed in 0.036 seconds, using GeSHi 1.0.8.4
and then:Using java Syntax Highlighting
scene.registerTouchArea(face); scene.setTouchAreaBindingEnabled(true); Parsed in 0.035 seconds, using GeSHi 1.0.8.4
but it won't work neither (onAreaTouched is never called).
Is it possible that the implementation of onOffsetsChanged provided by Kangee interferes somehow with the other methods ?? I mean, maybe when pOffsetsChangedListener has been treated all the other listeners are discarded ?
I'm quite new to Android and Java, so please don't be very rude if I'm saying a nonsense.
Anyone has been able to manage offset and touch events in a Live Wallpaper made with andengine ?
Thanx!
Kangee wrote:I upload the Eclipse-Project as Zip-File. I think this is the answer of all questions
Users browsing this forum: No registered users and 5 guests