Этап ширина и высота в неко
Цель платформы:NME-Neko
Привет мне нужна ширина этапа, поэтому я называю stage.stageWidth, как это:
public function new()
{
super();
sx = stage.stageWidth;
sy = stage.stageHeight;
}
но он проследил ошибку:
プロセスを実行中: C:\Motion-Twin\haxe\haxelib.exe run nme run "C:\Users\osibsam\Google 드라이브\3DBG\application.nmml" neko
Called from ? line 1
Called from ApplicationMain.hx line 39
Called from nme/Lib.hx line 77
Called from native/Lib.hx line 74
Called from native/Lib.hx line 88
Called from ApplicationMain.hx line 64
Called from C:\Motion-Twin\haxe/std/neko/_std/Type.hx line 103
Called from osibsam/Main.hx line 18
Called from osibsam/Main.hx line 30
Uncaught exception - Invalid field access : get_stageWidth
Done(1)
1 ответ
Пытаться:
import nme.Lib;
public function new()
{
super();
sx = Lib.current.stage.stageWidth;
sy = Lib.current.stage.stageHeight;
}