49 lines
1.2 KiB
Haxe
49 lines
1.2 KiB
Haxe
import openfl.display.Window;
|
|
import assets.Scanner;
|
|
import game.video.Mode;
|
|
import openfl.events.KeyboardEvent;
|
|
import openfl.display.Sprite;
|
|
import openfl.display.Stage;
|
|
import openfl.events.Event;
|
|
import game.Input;
|
|
import game.Game;
|
|
import game.video.Mode;
|
|
|
|
class Main extends Sprite {
|
|
public function new () {
|
|
super ();
|
|
this.addEventListener(Event.ADDED_TO_STAGE, onInit);
|
|
}
|
|
private function onInit(e:Event)
|
|
{
|
|
//Scanner.scanTextureDir();
|
|
stage.frameRate = 1000;
|
|
var game:Game = new Game(stage);
|
|
stage.addEventListener(Event.ENTER_FRAME, game.onEnterFrame);
|
|
stage.addEventListener(KeyboardEvent.KEY_DOWN,Input.onKeyIsDown);
|
|
stage.addEventListener(KeyboardEvent.KEY_UP,Input.onKeyIsUp);
|
|
stage.addEventListener(Event.RESIZE,onResize);
|
|
game.onInit();
|
|
//Mode.setVideoMode(1280, 960);
|
|
}
|
|
private function onResize (event:Event):Void {
|
|
|
|
//Here we can do shit with window scaling
|
|
//stage.stageWidth;
|
|
//stage.stageHeight;
|
|
}
|
|
|
|
// static function main () {
|
|
// // Bootstrap the OpenFL project
|
|
// var application = new lime.app.Application();
|
|
// application.createWindow({
|
|
// hidden: false,
|
|
// x: 0,
|
|
// y: 0,
|
|
// width: 800,
|
|
// height: 600,
|
|
// title: "DSTEngine Window"
|
|
// });
|
|
// }
|
|
|
|
} |