Haxeflixel 采用 Neko 构建,屏幕尺寸不适合

标签 haxe haxeflixel neko

我使用 Haxeflixel,选择构建目标 Neko 和 Neko 64。

我编码了 1280 x 720 分辨率,但执行的屏幕不适合。 也改变分辨率。

enter image description here

我刚刚重新安装了我的 os x yosemite 系统。是什么原因呢? 我无法理解这种情况

var 游戏宽度:Int = 1280;//游戏的宽度(以像素为单位)(实际像素可能会更少/更多,具体取决于您的缩放)。

var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom).
var initialState:Class<FlxState> = PlayState; // The FlxState the game starts with.
var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions.
var framerate:Int = 60; // How many frames per second the game should run at.
var skipSplash:Bool = false; // Whether to skip the flixel splash screen that appears in release mode.
var startFullscreen:Bool = false; // Whether to start the game in fullscreen on desktop targets

非常默认的设置...

最佳答案

如果我理解你的问题,问题是 gameWidthgameHeight 设置游戏的逻辑屏幕大小,而不是游戏运行的窗口的像素大小.

尝试更改项目的 Project.xml 文件中的窗口设置,以设置窗口的物理大小以匹配游戏坐标,它可能会开始看起来像您期望的那样:

<!--These window settings apply to all targets-->
<window width="1280" height="720" fps="60" background="#000000" hardware="true" vsync="true" />

关于Haxeflixel 采用 Neko 构建,屏幕尺寸不适合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30727749/

相关文章:

macros - 使用 Haxe 宏进行条件编译,而不是#if#end

haxe - 实例化FlxPoint的正确方法

haxe - 如何退出 Haxe/OpenFL 程序?

c - 对于小型设备,Hans Boehm GC 有哪些替代品?

html - 方法比较在 Neko 中失败但适用于 JavaScript

macros - 在宏中创建函数

json - 如何在 Haxe 中迭代动态对象

haxe - Haxe 是通过引用传递参数还是复制?

c++ - 如何使用来自 Haxe 的第三方 dll

Haxe/OpenFL/Flixel