-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
60 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/game/ui/component/Title.hx → src/game/ui/component/Text.hx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package ui.win; | ||
|
||
class DebugWindow extends ui.Window { | ||
public var updateCooldownS = 0.0; | ||
|
||
public function new(?renderCb:DebugWindow->Void) { | ||
super(false); | ||
|
||
if( renderCb!=null ) | ||
this.renderCb = renderCb; | ||
|
||
content.backgroundTile = Col.white().toTile(1,1, 0.5); | ||
content.padding = 4; | ||
content.horizontalSpacing = 4; | ||
content.verticalSpacing = 0; | ||
content.layout = Vertical; | ||
setAlign(End,Start); | ||
} | ||
|
||
public dynamic function renderCb(thisWin:DebugWindow) {} | ||
|
||
override function onResize() { | ||
super.onResize(); | ||
switch verticalAlign { | ||
case Start,End: content.maxHeight = Std.int( 0.4 * h()/Const.UI_SCALE ); | ||
case Center: content.maxHeight = Std.int( 0.8 * h()/Const.UI_SCALE ); | ||
case Fill: content.maxHeight = Std.int( h()/Const.UI_SCALE ); | ||
} | ||
} | ||
|
||
override function update() { | ||
super.update(); | ||
if( updateCooldownS<=0 || !cd.hasSetS("updateLock",updateCooldownS) ) | ||
renderCb(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters