2013-05-11 4 views
0

플랫폼 대상에서 높이 : NME-네코stageWidth로 & 네코

안녕하세요 단계의 폭이 필요합니다, 그래서 같이 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) 

답변

0

을 시도 :

import nme.Lib; 

public function new() 
{ 
    super(); 

    sx = Lib.current.stage.stageWidth; 
    sy = Lib.current.stage.stageHeight; 
}