nme

How to exit Haxe/OpenFL program?

人走茶凉 提交于 2019-12-12 08:41:18
问题 I am making a game using Haxe, OpenFL (Formerly NME) and HaxeFlixel. However, problem is, I can't seem to find a good way to make a Flixel button that will shutdown the game when pressed. I was planning to make a "quit" button on the main menu. Is there any simple method to do so or is it impossible? 回答1: It depends on the compilation target: I'm going to assume you're compiling to CPP (Windows EXE). In which case you should just be able to use the following: import flash.system.System; // Or

Haxe NME Resizing a Bitmap

送分小仙女□ 提交于 2019-12-12 02:56:41
问题 I am trying to learn NME with haxe to create a small game. I have setup NME 3.5.5 with Haxe 2.10 in FlashDevelop. To draw the game background, I'm using // Class level variable var background : nme.display.Bitmap; public function initResources() : Void { background = new Bitmap(Assets.getBitmapData("img/back.png")); } And in the render loop, I'm rendering like this. g.clear(); g.beginBitmapFill(background.bitmapData, true, true); g.drawRect(0, 0, 640, 480); g.endFill(); This is drawing the

FlashDevelop / Haxe - build halted with errors (haxelib.exe)

谁说我不能喝 提交于 2019-12-11 11:55:01
问题 I'm trying to get started with Haxe but I can't even get past the easiest step, compiling the "new project" template. I'm using FlashDevelop 4, installed Haxe and used the the command haxelib install openfl to install openfl (did the same for NME) though I still get the most basic compiler error: haxelib run openfl build C:\dev\haxeBox\openFlTest\application.xml android -debug [file_contents,C:\Program Files(x86)\Haxe\haxe\lib\openfl//.current] Build halted with errors (haxelib.exe). I've

Embeding and reading image assets when deploying to Windows

蹲街弑〆低调 提交于 2019-12-08 08:36:54
问题 In other platforms i could just use something like [Embed(source="logo.gif")] or @:bitmap, but it seems there is no option for that for Windows/Other Cpp platforms. I tried to use the EmbedAssets lib but it's outdated. I also tried using the nmml file resource tag. With this i could get the image as haxe.sys.io.Bytes, but to use i need to convert haxe.sys.io.Bytes to nme.utils.ByteArray. I have not found a way to do this. So, what can i do to embed images on a haxe/nme project when deploying

How to exit Haxe/OpenFL program?

这一生的挚爱 提交于 2019-12-04 04:05:11
I am making a game using Haxe, OpenFL (Formerly NME) and HaxeFlixel. However, problem is, I can't seem to find a good way to make a Flixel button that will shutdown the game when pressed. I was planning to make a "quit" button on the main menu. Is there any simple method to do so or is it impossible? It depends on the compilation target: I'm going to assume you're compiling to CPP (Windows EXE). In which case you should just be able to use the following: import flash.system.System; // Or nme.system.System if you're using NME ... // in your FlxButton callback: System.exit(0); I can't test right