2021-04-07 20:19:49 -04:00
|
|
|
package;
|
|
|
|
|
|
|
|
import flixel.FlxG;
|
|
|
|
import flixel.FlxSprite;
|
|
|
|
import flixel.FlxState;
|
2021-05-26 19:22:15 -04:00
|
|
|
import flixel.addons.display.FlxGridOverlay;
|
|
|
|
import flixel.graphics.frames.FlxAtlasFrames;
|
2021-04-07 20:19:49 -04:00
|
|
|
import openfl.Assets;
|
|
|
|
import sys.io.File;
|
|
|
|
|
|
|
|
class DebugBoundingState extends FlxState
|
|
|
|
{
|
|
|
|
override function create()
|
|
|
|
{
|
2021-05-26 19:22:15 -04:00
|
|
|
var bg:FlxSprite = FlxGridOverlay.create(10, 10);
|
|
|
|
|
|
|
|
bg.scrollFactor.set();
|
|
|
|
add(bg);
|
|
|
|
|
|
|
|
var tex = Paths.getSparrowAtlas('characters/temp');
|
|
|
|
// tex.frames[0].uv
|
|
|
|
|
|
|
|
var bf:FlxSprite = new FlxSprite();
|
|
|
|
bf.loadGraphic(tex.parent);
|
2021-04-07 20:19:49 -04:00
|
|
|
add(bf);
|
|
|
|
|
|
|
|
FlxG.stage.window.onDropFile.add(function(path:String)
|
|
|
|
{
|
|
|
|
trace("DROPPED FILE FROM: " + Std.string(path));
|
|
|
|
var newPath = "./" + Paths.image('characters/temp');
|
|
|
|
File.copy(path, newPath);
|
|
|
|
|
|
|
|
var swag = Paths.image('characters/temp');
|
|
|
|
|
|
|
|
if (bf != null)
|
|
|
|
remove(bf);
|
|
|
|
FlxG.bitmap.removeByKey(Paths.image('characters/temp'));
|
|
|
|
Assets.cache.clear();
|
|
|
|
|
|
|
|
bf.loadGraphic(Paths.image('characters/temp'));
|
|
|
|
add(bf);
|
|
|
|
});
|
|
|
|
|
|
|
|
super.create();
|
|
|
|
}
|
2021-05-26 19:22:15 -04:00
|
|
|
|
|
|
|
override function update(elapsed:Float)
|
|
|
|
{
|
|
|
|
CoolUtil.mouseCamDrag();
|
|
|
|
super.update(elapsed);
|
|
|
|
}
|
2021-04-07 20:19:49 -04:00
|
|
|
}
|