1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-23 13:07:07 +00:00

FlxActions/Controls.hx stuf for Android keys

This commit is contained in:
Cameron Taylor 2021-08-23 18:52:38 -04:00
parent f40b3a8fe3
commit d77a983ff2
3 changed files with 22 additions and 2 deletions

View file

@ -12,7 +12,7 @@ import openfl.display.Sprite;
class Preloader extends FlxBasePreloader
{
public function new(MinDisplayTime:Float = 3, ?AllowedURLs:Array<String>)
public function new(MinDisplayTime:Float = 0, ?AllowedURLs:Array<String>)
{
super(MinDisplayTime, AllowedURLs);
}

View file

@ -10,7 +10,7 @@
<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"-->
<!-- <app preloader="Preloader" resizable="true" /> -->
<app preloader="flixel.system.FlxPreloader" />
<app preloader="Preloader" />
<!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2-->
<set name="SWF_VERSION" value="11.8" />

View file

@ -8,6 +8,7 @@ import flixel.addons.transition.FlxTransitionableState;
import flixel.effects.FlxFlicker;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.input.touch.FlxTouch;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
@ -249,6 +250,25 @@ class MainMenuState extends MusicBeatState
override function update(elapsed:Float)
{
if (FlxG.onMobile)
{
var touch:FlxTouch = FlxG.touches.getFirst();
if (touch != null)
{
for (item in menuItems)
{
if (touch.overlaps(item))
{
if (menuItems.selectedIndex == item.ID && touch.justPressed)
menuItems.accept();
else
menuItems.selectItem(item.ID);
}
}
}
}
// FlxG.camera.followLerp = CoolUtil.camLerpShit(0.06);
if (FlxG.sound.music.volume < 0.8)