Skip to content

Commit e0a9482

Browse files
committed
FIX w()/h() warnings
1 parent 20dca54 commit e0a9482

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/game/Camera.hx

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ class Camera extends GameChildProcess {
116116
}
117117

118118
function get_pxWid() {
119-
return M.ceil( Game.ME.w() / Const.SCALE / zoom );
119+
return M.ceil( Game.ME.stageWid / Const.SCALE / zoom );
120120
}
121121

122122
function get_pxHei() {
123-
return M.ceil( Game.ME.h() / Const.SCALE / zoom );
123+
return M.ceil( Game.ME.stageHei / Const.SCALE / zoom );
124124
}
125125

126126

src/game/Fx.hx

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ class Fx extends GameChildProcess {
143143
public inline function flashBangS(c:Col, a:Float, t=0.1) {
144144
var e = new h2d.Bitmap(h2d.Tile.fromColor(c,1,1,a));
145145
game.root.add(e, Const.DP_FX_FRONT);
146-
e.scaleX = game.w();
147-
e.scaleY = game.h();
146+
e.scaleX = game.stageWid;
147+
e.scaleY = game.stageHei;
148148
e.blendMode = Add;
149149
game.tw.createS(e.alpha, 0, t).end( function() {
150150
e.remove();

src/game/ui/Hud.hx

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Hud extends GameChildProcess {
4242
else
4343
debugText.text += "\n"+v;
4444
debugText.visible = true;
45-
debugText.x = Std.int( w()/Const.UI_SCALE - 4 - debugText.textWidth );
45+
debugText.x = Std.int( stageWid/Const.UI_SCALE - 4 - debugText.textWidth );
4646
}
4747

4848

@@ -61,7 +61,7 @@ class Hud extends GameChildProcess {
6161
// Text
6262
var tf = new h2d.Text(Assets.fontPixel, f);
6363
tf.text = str;
64-
tf.maxWidth = 0.6 * w()/Const.UI_SCALE;
64+
tf.maxWidth = 0.6 * stageWid/Const.UI_SCALE;
6565
tf.textColor = 0xffffff;
6666
tf.filter = new dn.heaps.filter.PixelOutline( color.toBlack(0.2) );
6767

src/game/ui/Window.hx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ enum WindowAlign {
1010
class Window extends dn.Process {
1111
public static var ALL : Array<Window> = [];
1212

13-
var uiWid(get,never) : Int; inline function get_uiWid() return M.ceil( w()/Const.UI_SCALE );
14-
var uiHei(get,never) : Int; inline function get_uiHei() return M.ceil( h()/Const.UI_SCALE );
13+
var uiWid(get,never) : Int; inline function get_uiWid() return M.ceil( stageWid/Const.UI_SCALE );
14+
var uiHei(get,never) : Int; inline function get_uiHei() return M.ceil( stageHei/Const.UI_SCALE );
1515

1616
public var content: h2d.Flow;
1717

src/game/ui/win/DebugWindow.hx

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class DebugWindow extends ui.Window {
2222
override function onResize() {
2323
super.onResize();
2424
switch verticalAlign {
25-
case Start,End: content.maxHeight = Std.int( 0.4 * h()/Const.UI_SCALE );
26-
case Center: content.maxHeight = Std.int( 0.8 * h()/Const.UI_SCALE );
27-
case Fill: content.maxHeight = Std.int( h()/Const.UI_SCALE );
25+
case Start,End: content.maxHeight = Std.int( 0.4 * stageHei/Const.UI_SCALE );
26+
case Center: content.maxHeight = Std.int( 0.8 * stageHei/Const.UI_SCALE );
27+
case Fill: content.maxHeight = Std.int( stageHei/Const.UI_SCALE );
2828
}
2929
}
3030

src/game/ui/win/SimpleMenu.hx

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class SimpleMenu extends ui.Window {
2525
override function onResize() {
2626
super.onResize();
2727
switch verticalAlign {
28-
case Start,End: content.maxHeight = Std.int( 0.4 * h()/Const.UI_SCALE );
29-
case Center: content.maxHeight = Std.int( 0.8 * h()/Const.UI_SCALE );
30-
case Fill: content.maxHeight = Std.int( h()/Const.UI_SCALE );
28+
case Start,End: content.maxHeight = Std.int( 0.4 * stageHei/Const.UI_SCALE );
29+
case Center: content.maxHeight = Std.int( 0.8 * stageHei/Const.UI_SCALE );
30+
case Fill: content.maxHeight = Std.int( stageHei/Const.UI_SCALE );
3131
}
3232
}
3333

0 commit comments

Comments
 (0)