1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-25 16:24:40 +00:00

Stage builder improvements, Weekend 1 stage

This commit is contained in:
Eric Myllyoja 2022-09-08 01:09:22 -04:00
parent d84be39a5e
commit baab8e101f
3 changed files with 20 additions and 50 deletions

View file

@ -200,8 +200,8 @@
<haxeflag name="-dce no" />
<haxeflag name="--macro" value="include('funkin')" />
<!-- Ensure all UI components are available at runtime. -->
<haxeflag name="--macro" value="include('haxe.ui.components')" />
<haxeflag name="--macro" value="include('haxe.ui.containers')" />
<haxeflag name="--macro" value="include('haxe.ui.components')" />
<haxeflag name="--macro" value="include('haxe.ui.containers')" />
<!-- Necessary to provide stack traces for HScript. -->
<haxedef name="hscriptPos" />

View file

@ -4,6 +4,7 @@ import flixel.FlxGame;
import flixel.FlxState;
import funkin.InitState;
import funkin.MemoryCounter;
import haxe.ui.Toolkit;
import openfl.Lib;
import openfl.display.FPS;
import openfl.display.Sprite;
@ -95,6 +96,8 @@ class Main extends Sprite
initialState = TitleState;
#end
initHaxeUI();
addChild(new FlxGame(gameWidth, gameHeight, initialState, framerate, framerate, skipSplash, startFullscreen));
#if debug
@ -105,53 +108,14 @@ class Main extends Sprite
addChild(memoryCounter);
#end
#end
/*
video = new Video();
addChild(video);
var netConnection = new NetConnection();
netConnection.connect(null);
netStream = new NetStream(netConnection);
netStream.client = {onMetaData: client_onMetaData};
netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, netStream_onAsyncError);
#if (js && html5)
overlay = new Sprite();
overlay.graphics.beginFill(0, 0.5);
overlay.graphics.drawRect(0, 0, 560, 320);
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
overlay.buttonMode = true;
addChild(overlay);
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_onNetStatus);
#else
netStream.play("assets/preload/music/dredd.mp4");
#end
*/
}
/*
private function client_onMetaData(metaData:Dynamic)
{
video.attachNetStream(netStream);
video.width = video.videoWidth;
video.height = video.videoHeight;
}
private function netStream_onAsyncError(event:AsyncErrorEvent):Void
{
trace("Error loading video");
}
private function netConnection_onNetStatus(event:NetStatusEvent):Void
{
}
private function overlay_onMouseDown(event:MouseEvent):Void
{
netStream.play("assets/preload/music/dredd.mp4");
}
*/
function initHaxeUI()
{
// Calling this before any HaxeUI components get used is important:
// - It initializes the theme styles.
// - It scans the class path and registers any HaxeUI components.
Toolkit.init();
Toolkit.theme = "dark"; // don't be cringe
}
}

View file

@ -4,7 +4,6 @@ import flixel.FlxSprite;
import flixel.input.mouse.FlxMouseEvent;
import flixel.math.FlxPoint;
import funkin.play.PlayState;
import funkin.play.character.BaseCharacter;
import funkin.play.stage.StageData;
import haxe.ui.RuntimeComponentBuilder;
import haxe.ui.core.Component;
@ -77,11 +76,18 @@ class StageOffsetSubstate extends MusicBeatSubstate
char.y = sprOld.y - (mosPosOld.y - FlxG.mouse.y);
}
FlxG.mouse.visible = true;
CoolUtil.mouseCamDrag();
if (FlxG.keys.pressed.CONTROL)
CoolUtil.mouseWheelZoom();
if (FlxG.mouse.wheel != 0)
{
FlxG.camera.zoom += FlxG.mouse.wheel * 0.1;
}
if (FlxG.keys.justPressed.Y)
{
for (thing in PlayState.instance.currentStage)