Comfort way to get (crossplatform) justpress || justtouch point relative coordinates for playstate
-
have any prefer comfort simple way to get relative coordinates from playstate?
in my code i use syntax
"
144 _xpressed = FlxG.mouse.screenX / PS._sdpi;
...
710 if (FlxG.mouse.justPressed)
"
Windows , neko work done, but when i try build android, have errors
"
$ lime build android
source/PS.hx:144: characters 14-24 : Class<flixel.FlxG> has no field mouse
source/PS.hx:710: characters 6-16 : Class<flixel.FlxG> has no field mouse
"
have any way to get RELATIVE press || touch platform auto determine method?
or i must write something as
#if mobile ....?
-
You should use
FlxG.touches
on Android
and putFlxG.mouse
inside a conditional compilation flags#if !FLX_NO_MOUSE _xpressed = FlxG.mouse.screenX / PS._sdpi; #end
-
@DleanJeans can't find description in manual... is it unofficial?
-
Manual? Which manual?
-
@DleanJeans http://api.haxeflixel.com/flixel/FlxG.html
for example etc
-
It's probably somewhere in the documentation and it's definitely official
-
@DleanJeans Solved.
Gama11, in irc, say comment line which turn off mouse if mobile in Project.xml . I do this, then build apk , then test samsung gt2 10.1 , and my touch automatically convert in justpress etc.Now have little bug with png big pictures of background and buttons look like black rectangles, but it another problem... this step solved.