Comments (9)
Hi the java is not contained into the so, you just have to edit the java class.
To rebuild the .so just execute the android.sh file in the project folder.
from hypertouch.
Ok, editing the java files only works, , but in my project(haxeflixel),everytime I do a gesture, the whole game crashes.
What I did is :
Is this setup ok, or I did something wrong? Thanks
In main.hx:
#if mobile
import fr.hyperfiction.hypertouch.HyperTouch;
import fr.hyperfiction.hypertouch.events.GestureTapEvent;
import fr.hyperfiction.hypertouch.events.TransformGestureEvent;
import fr.hyperfiction.hypertouch.events.GestureLongPressEvent;
#end^
private function setupGame():Void
{
//gestures
#if mobile
var hyp = HyperTouch.getInstance();
hyp.add( TAP( 1 , 1 ));//Single Tap
hyp.add( TAP( 2 , 1 ));//Two Fingers Taps
hyp.add( GESTURE_SWIPE );//Swipe Gesture
hyp.add( LONGPRESS );//Swipe Gesture
Lib.current.stage.addEventListener( GestureTapEvent.TAP , FTap );
Lib.current.stage.addEventListener( GestureLongPressEvent.LONG_PRESS , FLongPress );
Lib.current.stage.addEventListener( TransformGestureEvent.GESTURE_SWIPE , FSwipeTrace);
//FlxG.stage.addEventListener( TransformGestureEvent.GESTURE_SWIPE , FSwipeTrace);
#end
//end gestures
var stageWidth:Int = Lib.current.stage.stageWidth;
var stageHeight:Int = Lib.current.stage.stageHeight;
if (zoom == -1)
{
var ratioX:Float = stageWidth / gameWidth;
var ratioY:Float = stageHeight / gameHeight;
zoom = Math.min(ratioX, ratioY);
gameWidth = Math.ceil(stageWidth / zoom);
gameHeight = Math.ceil(stageHeight / zoom);
}
addChild(new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen));
}
//gestures
#if mobile
private function FSwipeTrace(e : TransformGestureEvent = null):Void
{
//trace("Swipe!");
//FlxG.switchState(new PlayState());
//FlxG.debugger.visible = false;
// trace(e.direction);
}
private function FLongPress(e : GestureLongPressEvent = null):Void
{
trace("longPress");
}
private function FTap(e : GestureTapEvent = null):Void
{
trace("tap-pos: ["+e.stageX+","+e.stageY+"]");
}
#end
//end gestures
from hypertouch.
It's probably due to the issue i reported here:
openfl/openfl-native#216
You can downgrade to OpenFL 1.3 for noz
from hypertouch.
Thanks, will try
from hypertouch.
Is this affecting the HypFacebook also?
Thanks
from hypertouch.
Yeah
from hypertouch.
I manage to get admob working from this:
https://github.com/mkorman9/admob-openfl
What's the difference between this implementation and yours?
After all the extension is about calling native code , no?
from hypertouch.
If you read the bug report i linked earlier, it's not about calling native code, it's about receiving callbacks from it.
from hypertouch.
if i downgrade only openfl and openfl native to 1.3.0 the game compiles but crashes.
The game without your extension works fine
from hypertouch.
Related Issues (10)
- Retina display & CGPoint coordinates ( iOs )
- Android - Activity bug
- Pan gesture & Android HOT 14
- Android : doubleTap event received twice HOT 3
- When I compile my nmml, I got an error.
- can't found the library. did I miss something? HOT 8
- Upgrading to openfl HOT 5
- org.shoebox NativeMirror HOT 4
- Android : Compatibility borken with OPENFL 1.2 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hypertouch.