Skip to content

Commit

Permalink
Renamed w/h() to stageWid/Hei
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed May 20, 2024
1 parent fbf9ecc commit b0f774f
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/dn/Process.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class Process {
var children : FixedArray<Process>;
#end

public var stageWid(get,never) : Int;
public var stageHei(get,never) : Int;

public var scaleStageWid(get,never) : Int; inline function get_scaleStageWid() return M.ceil( w() / (root!=null?root.scaleX:1) );
public var scaleStageHei(get,never) : Int; inline function get_scaleStageHei() return M.ceil( h() / (root!=null?root.scaleY:1) );

/** Delayer allows for callbacks to be called in a future frame **/
public var delayer : dn.Delayer;

Expand Down Expand Up @@ -393,27 +399,36 @@ class Process {


/** Get graphical context width **/
public inline function w(){
@:noCompletion @:deprecated("Use stageWid variable instead")
public inline function w() return stageWid;

inline function get_stageWid(){
if( CUSTOM_STAGE_WIDTH > 0 )
return CUSTOM_STAGE_WIDTH;

#if heaps
return hxd.Window.getInstance().width;
return hxd.Window.getInstance().width;
#else
return 1;
return 1;
#end
}

/** Get graphical context height **/
public inline function h(){
@:noCompletion @:deprecated("Use stageHei variable instead")
public inline function h() return stageHei;

inline function get_stageHei(){
if( CUSTOM_STAGE_HEIGHT > 0 )
return CUSTOM_STAGE_HEIGHT;

#if heaps
return hxd.Window.getInstance().height;
return hxd.Window.getInstance().height;
#else
return 1;
return 1;
#end
}


inline function anyParentPaused() {
return parent!=null ? parent.isPaused() : false;
}
Expand Down

0 comments on commit b0f774f

Please sign in to comment.