mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-01-30 08:27:38 +00:00
middle click drag
This commit is contained in:
parent
bd6936734a
commit
30a6db615b
|
@ -124,13 +124,13 @@
|
||||||
<!--haxelib name="newgrounds" unless="switch"/> -->
|
<!--haxelib name="newgrounds" unless="switch"/> -->
|
||||||
<haxelib name="faxe" if='switch'/>
|
<haxelib name="faxe" if='switch'/>
|
||||||
<haxelib name="polymod"/>
|
<haxelib name="polymod"/>
|
||||||
<haxelib name="newgrounds"/>
|
<!-- <haxelib name="newgrounds"/> -->
|
||||||
<haxelib name="hxcpp-debug-server" if="desktop debug"/>
|
<haxelib name="hxcpp-debug-server" if="desktop debug"/>
|
||||||
|
|
||||||
<!-- swf stufffff -->
|
<!-- swf stufffff -->
|
||||||
<haxelib name="swf"/>
|
<!-- <haxelib name="swf"/> -->
|
||||||
<library path="assets/tanky.swf" preload="true"/>
|
<!-- <library path="assets/tanky.swf" preload="true"/> -->
|
||||||
<library path="assets/tankBG.swf" preload="true"/>
|
<!-- <library path="assets/tankBG.swf" preload="true"/> -->
|
||||||
|
|
||||||
<!-- <haxelib name="flixel-animate" /> -->
|
<!-- <haxelib name="flixel-animate" /> -->
|
||||||
<!-- <haxelib name="spinehaxe" /> -->
|
<!-- <haxelib name="spinehaxe" /> -->
|
||||||
|
|
|
@ -34,6 +34,7 @@ import shaderslmfao.BuildingShaders.BuildingShader;
|
||||||
import shaderslmfao.BuildingShaders;
|
import shaderslmfao.BuildingShaders;
|
||||||
import shaderslmfao.ColorSwap;
|
import shaderslmfao.ColorSwap;
|
||||||
import ui.PreferencesMenu;
|
import ui.PreferencesMenu;
|
||||||
|
import ui.stageBuildShit.StageBuilderState;
|
||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
|
||||||
|
@ -152,6 +153,8 @@ class TitleState extends MusicBeatState
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||||
|
#elseif STAGEBUILD
|
||||||
|
FlxG.switchState(new StageBuilderState());
|
||||||
#else
|
#else
|
||||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
package ui;
|
|
||||||
|
|
||||||
import flixel.FlxSprite;
|
|
||||||
import flixel.addons.display.FlxGridOverlay;
|
|
||||||
|
|
||||||
class StageBuilderState extends MusicBeatState
|
|
||||||
{
|
|
||||||
public function new()
|
|
||||||
{
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
override function create()
|
|
||||||
{
|
|
||||||
super.create();
|
|
||||||
|
|
||||||
var bg:FlxSprite = FlxGridOverlay.create(10, 10);
|
|
||||||
add(bg);
|
|
||||||
}
|
|
||||||
}
|
|
61
source/ui/stageBuildShit/StageBuilderState.hx
Normal file
61
source/ui/stageBuildShit/StageBuilderState.hx
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
package ui.stageBuildShit;
|
||||||
|
|
||||||
|
import flixel.FlxG;
|
||||||
|
import flixel.FlxSprite;
|
||||||
|
import flixel.addons.display.FlxGridOverlay;
|
||||||
|
import flixel.group.FlxGroup;
|
||||||
|
import flixel.math.FlxPoint;
|
||||||
|
import flixel.ui.FlxButton;
|
||||||
|
|
||||||
|
class StageBuilderState extends MusicBeatState
|
||||||
|
{
|
||||||
|
private var hudGrp:FlxGroup;
|
||||||
|
|
||||||
|
private var sprGrp:FlxGroup;
|
||||||
|
|
||||||
|
override function create()
|
||||||
|
{
|
||||||
|
super.create();
|
||||||
|
|
||||||
|
FlxG.mouse.visible = true;
|
||||||
|
|
||||||
|
var bg:FlxSprite = FlxGridOverlay.create(10, 10);
|
||||||
|
add(bg);
|
||||||
|
|
||||||
|
sprGrp = new FlxGroup();
|
||||||
|
add(sprGrp);
|
||||||
|
|
||||||
|
hudGrp = new FlxGroup();
|
||||||
|
add(hudGrp);
|
||||||
|
|
||||||
|
var imgBtn:FlxButton = new FlxButton(20, 20, "Load Image", loadImage);
|
||||||
|
hudGrp.add(imgBtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadImage():Void
|
||||||
|
{
|
||||||
|
var img:FlxSprite = new FlxSprite().loadGraphic(Paths.image('newgrounds_logo'));
|
||||||
|
img.scrollFactor.set(0.5, 2);
|
||||||
|
sprGrp.add(img);
|
||||||
|
}
|
||||||
|
|
||||||
|
var oldCamPos:FlxPoint = new FlxPoint();
|
||||||
|
var oldMousePos:FlxPoint = new FlxPoint();
|
||||||
|
|
||||||
|
override function update(elapsed:Float)
|
||||||
|
{
|
||||||
|
if (FlxG.mouse.justPressedMiddle)
|
||||||
|
{
|
||||||
|
oldCamPos.set(FlxG.camera.scroll.x, FlxG.camera.scroll.y);
|
||||||
|
oldMousePos.set(FlxG.mouse.screenX, FlxG.mouse.screenY);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FlxG.mouse.pressedMiddle)
|
||||||
|
{
|
||||||
|
FlxG.camera.scroll.x = oldCamPos.x + (FlxG.mouse.screenX - oldMousePos.x);
|
||||||
|
FlxG.camera.scroll.y = oldCamPos.y + (FlxG.mouse.screenY - oldMousePos.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
super.update(elapsed);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue