GithubHelp home page GithubHelp logo

Comments (9)

shoebox avatar shoebox commented on August 24, 2024

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.

paala avatar paala commented on August 24, 2024

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.

shoebox avatar shoebox commented on August 24, 2024

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.

paala avatar paala commented on August 24, 2024

Thanks, will try

from hypertouch.

paala avatar paala commented on August 24, 2024

Is this affecting the HypFacebook also?

Thanks

from hypertouch.

shoebox avatar shoebox commented on August 24, 2024

Yeah

from hypertouch.

paala avatar paala commented on August 24, 2024

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.

shoebox avatar shoebox commented on August 24, 2024

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.

paala avatar paala commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.