Skip to content

Commit

Permalink
fix button positions. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Jun 4, 2024
1 parent 838aa0e commit 445b924
Show file tree
Hide file tree
Showing 20 changed files with 140 additions and 138 deletions.
4 changes: 2 additions & 2 deletions Assets/Script/Game/Loli War/Control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ local root = AlignNode(true) -- 23
root:css('flex-direction: column; justify-content: space-between') -- 24
root:addChild((function() -- 25
local _with_0 = AlignNode() -- 25
_with_0:css('width: 10; height: 10; margin-top: 75; margin-left: 75') -- 26
_with_0:css('width: 10; height: 10; margin-top: 50; margin-left: 60') -- 26
_with_0:addChild(HPWheel()) -- 27
return _with_0 -- 25
end)()) -- 25
root:addChild((function() -- 28
local _with_0 = AlignNode() -- 28
_with_0:css('margin-bottom: 10; height: 104; flex-direction: row; justify-content: space-between') -- 29
_with_0:css('margin: 0, 10, 40; height: 104; flex-direction: row; justify-content: space-between') -- 29
local _exp_0 = App.platform -- 30
if "iOS" == _exp_0 or "Android" == _exp_0 then -- 31
_with_0:addChild((function() -- 32
Expand Down
4 changes: 2 additions & 2 deletions Assets/Script/Game/Loli War/Control.yue
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ updatePlayerControl = (key, flag) ->
with root = AlignNode true
\css 'flex-direction: column; justify-content: space-between'
\addChild with AlignNode!
\css 'width: 10; height: 10; margin-top: 75; margin-left: 75'
\css 'width: 10; height: 10; margin-top: 50; margin-left: 60'
\addChild HPWheel!
\addChild with AlignNode!
\css 'margin-bottom: 10; height: 104; flex-direction: row; justify-content: space-between'
\css 'margin: 0, 10, 40; height: 104; flex-direction: row; justify-content: space-between'
switch App.platform
when "iOS", "Android"
\addChild with AlignNode!
Expand Down
2 changes: 2 additions & 0 deletions Assets/Script/Game/Loli War/UI/View/HPWheel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ local Digit = require("UI.Control.Digit") -- 2
return function(args) -- 1
local _ENV = Dora(args) -- 1
local node1 = Node() -- 4
node1.scaleX = 0.75 -- 4
node1.scaleY = 0.75 -- 4
local hpShow = Playable("model:Model/hpshow") -- 5
hpShow.scaleX = 2 -- 5
hpShow.scaleY = 2 -- 5
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Game/Loli War/UI/View/HPWheel.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Dora>
<Import Module="UI.Control.Digit"/>

<Node>
<Node ScaleX="0.75" ScaleY="0.75">
<Playable Name="hpShow" File="model:Model/hpshow" Look="8" Play="idle" Loop="True" ScaleX="2" ScaleY="2" Ref="True"/>
<Node Name="energy" X="75" Y="20" ScaleX="2" ScaleY="2" Ref="True">
<Sprite File="Model/misc.clip|enegyframe" AnchorX="0"/>
Expand Down
4 changes: 2 additions & 2 deletions Assets/Script/Game/Loli War/UI/View/LeftTouchPad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ return function(args) -- 1
local _ENV = Dora(args) -- 1
local pad = Menu() -- 4
pad.anchor = Vec2(0,0) -- 4
pad.scaleX = 2 -- 4
pad.scaleY = 2 -- 4
pad.scaleX = 1.5 -- 4
pad.scaleY = 1.5 -- 4
pad.size = Size(114,52) -- 4
local item1 = Button{height = 52, width = 52, imageDown = 'keyleft_down', imageUp = 'keyleft_up'} -- 5
pad:addChild(item1) -- 5
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Game/Loli War/UI/View/LeftTouchPad.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Dora>
<Import Module="UI.View.Button"/>

<Menu Name="pad" AnchorX="0" AnchorY="0" Width="114" Height="52" ScaleX="2" ScaleY="2">
<Menu Name="pad" AnchorX="0" AnchorY="0" Width="114" Height="52" ScaleX="1.5" ScaleY="1.5">
<Button ImageUp="{ 'keyleft_up' }" ImageDown="{ 'keyleft_down' }" Width="52" Height="52">
<Slot Name="TapBegan"><Lua>pad:emit("KeyLeftDown")</Lua></Slot>
<Slot Name="TapEnded"><Lua>pad:emit("KeyLeftUp")</Lua></Slot>
Expand Down
4 changes: 2 additions & 2 deletions Assets/Script/Game/Loli War/UI/View/RightTouchPad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ return function(args) -- 1
local _ENV = Dora(args) -- 1
local pad = Menu() -- 4
pad.anchor = Vec2(1,0) -- 4
pad.scaleX = 2 -- 4
pad.scaleY = 2 -- 4
pad.scaleX = 1.5 -- 4
pad.scaleY = 1.5 -- 4
pad.size = Size(114,52) -- 4
local item1 = Button{height = 52, width = 52, imageDown = 'keyf_down', imageUp = 'keyf_up'} -- 5
pad:addChild(item1) -- 5
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Game/Loli War/UI/View/RightTouchPad.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Dora>
<Import Module="UI.View.Button"/>

<Menu Name="pad" AnchorX="1" AnchorY="0" Width="114" Height="52" ScaleX="2" ScaleY="2">
<Menu Name="pad" AnchorX="1" AnchorY="0" Width="114" Height="52" ScaleX="1.5" ScaleY="1.5">
<Button ImageUp="{ 'keyf_up' }" ImageDown="{ 'keyf_down' }" Width="52" Height="52">
<Slot Name="TapBegan"><Lua>pad:emit("KeyFDown")</Lua></Slot>
<Slot Name="TapEnded"><Lua>pad:emit("KeyFUp")</Lua></Slot>
Expand Down
2 changes: 2 additions & 0 deletions Assets/Script/Game/Loli War/UI/View/StartPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ local node1 = Node() -- 4
node1.touchEnabled = true -- 4
node1.swallowTouches = true -- 4
local node = Sprite("Model/misc.clip|startboard") -- 5
node.scaleX = 0 -- 5
node.scaleY = 0 -- 5
node1:addChild(node) -- 5
node1.node = node -- 5
local scaleOut = Action(Sequence(Spawn(Scale(1,1,0.3,Ease.InBack),Opacity(1,1,0)),Event("PanelHide"))) -- 7
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Game/Loli War/UI/View/StartPanel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Module="UI.Control.ButtonGlow"/>

<Node TouchEnabled="True" SwallowTouches="True">
<Sprite File="Model/misc.clip|startboard" Name="node" Ref="True">
<Sprite File="Model/misc.clip|startboard" Name="node" ScaleX="0" ScaleY="0" Ref="True">
<Action>
<Sequence Name="scaleOut">
<Spawn>
Expand Down
224 changes: 112 additions & 112 deletions Assets/Script/Game/Zombie Escape/Control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,118 +31,118 @@ do -- 20
_with_0.visible = false -- 22
_with_0:addChild((function() -- 23
local _with_1 = AlignNode() -- 23
_with_1:css("\n width: auto;\n height: 60;\n margin-bottom: 10;\n margin-left: 10;\n margin-right: 10;\n flex-direction: row;\n justify-content: space-between\n ") -- 24
_with_1:addChild((function() -- 33
local _with_2 = AlignNode() -- 33
_with_2:css('height: 60; width: 0') -- 34
_with_2:addChild((function() -- 35
local _with_3 = Menu() -- 35
_with_3.anchor = Vec2.zero -- 36
_with_3.size = Size(130, 60) -- 37
_with_3:addChild((function() -- 38
local _with_4 = CircleButton({ -- 39
text = "Left", -- 39
radius = 60, -- 40
fontSize = math.floor(36) -- 41
}) -- 38
_with_4.scaleX = 0.5 -- 43
_with_4.scaleY = 0.5 -- 43
_with_4.anchor = Vec2.zero -- 44
_with_4:slot("TapBegan", function() -- 45
return updatePlayerControl("keyLeft", true) -- 45
end) -- 45
_with_4:slot("TapEnded", function() -- 46
return updatePlayerControl("keyLeft", false) -- 46
end) -- 46
return _with_4 -- 38
end)()) -- 38
_with_3:addChild((function() -- 47
local _with_4 = CircleButton({ -- 48
text = "Right", -- 48
x = 70, -- 49
radius = 60, -- 50
fontSize = math.floor(36) -- 51
}) -- 47
_with_4.scaleX = 0.5 -- 53
_with_4.scaleY = 0.5 -- 53
_with_4.anchor = Vec2.zero -- 54
_with_4:slot("TapBegan", function() -- 55
return updatePlayerControl("keyRight", true) -- 55
end) -- 55
_with_4:slot("TapEnded", function() -- 56
return updatePlayerControl("keyRight", false) -- 56
end) -- 56
return _with_4 -- 47
end)()) -- 47
return _with_3 -- 35
end)()) -- 35
return _with_2 -- 33
end)()) -- 33
_with_1:addChild((function() -- 57
local _with_2 = AlignNode() -- 57
_with_2:css('height: 60; width: 0') -- 58
_with_2:addChild((function() -- 59
local _with_3 = Menu() -- 59
_with_3.anchor = Vec2(1, 0) -- 60
_with_3.size = Size(130, 60) -- 61
_with_3:addChild((function() -- 62
local _with_4 = CircleButton({ -- 63
text = "Jump", -- 63
radius = 60, -- 64
fontSize = math.floor(36) -- 65
}) -- 62
_with_4.scaleX = 0.5 -- 67
_with_4.scaleY = 0.5 -- 67
_with_4.anchor = Vec2.zero -- 68
_with_4:slot("TapBegan", function() -- 69
return updatePlayerControl("keyUp", true) -- 69
end) -- 69
_with_4:slot("TapEnded", function() -- 70
return updatePlayerControl("keyUp", false) -- 70
end) -- 70
return _with_4 -- 62
end)()) -- 62
_with_3:addChild((function() -- 71
local _with_4 = CircleButton({ -- 72
text = "Shoot", -- 72
x = 70, -- 73
radius = 60, -- 74
fontSize = math.floor(36) -- 75
}) -- 71
_with_4.scaleX = 0.5 -- 77
_with_4.scaleY = 0.5 -- 77
_with_4.anchor = Vec2.zero -- 78
_with_4:slot("TapBegan", function() -- 79
return updatePlayerControl("keyShoot", true) -- 79
end) -- 79
_with_4:slot("TapEnded", function() -- 80
return updatePlayerControl("keyShoot", false) -- 80
end) -- 80
return _with_4 -- 71
end)()) -- 71
return _with_3 -- 59
end)()) -- 59
return _with_2 -- 57
end)()) -- 57
_with_1:css("\n width: auto;\n height: 60;\n margin: 0, 20, 40;\n flex-direction: row;\n justify-content: space-between\n ") -- 24
_with_1:addChild((function() -- 31
local _with_2 = AlignNode() -- 31
_with_2:css('height: 60; width: 0') -- 32
_with_2:addChild((function() -- 33
local _with_3 = Menu() -- 33
_with_3.anchor = Vec2.zero -- 34
_with_3.size = Size(130, 60) -- 35
_with_3:addChild((function() -- 36
local _with_4 = CircleButton({ -- 37
text = "Left", -- 37
radius = 60, -- 38
fontSize = math.floor(36) -- 39
}) -- 36
_with_4.scaleX = 0.5 -- 41
_with_4.scaleY = 0.5 -- 41
_with_4.anchor = Vec2.zero -- 42
_with_4:slot("TapBegan", function() -- 43
return updatePlayerControl("keyLeft", true) -- 43
end) -- 43
_with_4:slot("TapEnded", function() -- 44
return updatePlayerControl("keyLeft", false) -- 44
end) -- 44
return _with_4 -- 36
end)()) -- 36
_with_3:addChild((function() -- 45
local _with_4 = CircleButton({ -- 46
text = "Right", -- 46
x = 70, -- 47
radius = 60, -- 48
fontSize = math.floor(36) -- 49
}) -- 45
_with_4.scaleX = 0.5 -- 51
_with_4.scaleY = 0.5 -- 51
_with_4.anchor = Vec2.zero -- 52
_with_4:slot("TapBegan", function() -- 53
return updatePlayerControl("keyRight", true) -- 53
end) -- 53
_with_4:slot("TapEnded", function() -- 54
return updatePlayerControl("keyRight", false) -- 54
end) -- 54
return _with_4 -- 45
end)()) -- 45
return _with_3 -- 33
end)()) -- 33
return _with_2 -- 31
end)()) -- 31
_with_1:addChild((function() -- 55
local _with_2 = AlignNode() -- 55
_with_2:css('height: 60; width: 0') -- 56
_with_2:addChild((function() -- 57
local _with_3 = Menu() -- 57
_with_3.anchor = Vec2(1, 0) -- 58
_with_3.size = Size(130, 60) -- 59
_with_3:addChild((function() -- 60
local _with_4 = CircleButton({ -- 61
text = "Jump", -- 61
radius = 60, -- 62
fontSize = math.floor(36) -- 63
}) -- 60
_with_4.scaleX = 0.5 -- 65
_with_4.scaleY = 0.5 -- 65
_with_4.anchor = Vec2.zero -- 66
_with_4:slot("TapBegan", function() -- 67
return updatePlayerControl("keyUp", true) -- 67
end) -- 67
_with_4:slot("TapEnded", function() -- 68
return updatePlayerControl("keyUp", false) -- 68
end) -- 68
return _with_4 -- 60
end)()) -- 60
_with_3:addChild((function() -- 69
local _with_4 = CircleButton({ -- 70
text = "Shoot", -- 70
x = 70, -- 71
radius = 60, -- 72
fontSize = math.floor(36) -- 73
}) -- 69
_with_4.scaleX = 0.5 -- 75
_with_4.scaleY = 0.5 -- 75
_with_4.anchor = Vec2.zero -- 76
_with_4:slot("TapBegan", function() -- 77
return updatePlayerControl("keyShoot", true) -- 77
end) -- 77
_with_4:slot("TapEnded", function() -- 78
return updatePlayerControl("keyShoot", false) -- 78
end) -- 78
return _with_4 -- 69
end)()) -- 69
return _with_3 -- 57
end)()) -- 57
return _with_2 -- 55
end)()) -- 55
return _with_1 -- 23
end)()) -- 23
_with_0:addTo((function() -- 81
local _with_1 = Director.ui -- 81
_with_1.renderGroup = true -- 82
return _with_1 -- 81
end)()) -- 81
_with_0:addTo((function() -- 79
local _with_1 = Director.ui -- 79
_with_1.renderGroup = true -- 80
return _with_1 -- 79
end)()) -- 79
end -- 20
Store.keyboardEnabled = false -- 84
local keyboardControl -- 85
keyboardControl = function() -- 85
if not Store.keyboardEnabled then -- 86
return -- 86
end -- 86
updatePlayerControl("keyLeft", Keyboard:isKeyPressed("A")) -- 87
updatePlayerControl("keyRight", Keyboard:isKeyPressed("D")) -- 88
updatePlayerControl("keyUp", Keyboard:isKeyPressed("K")) -- 89
return updatePlayerControl("keyShoot", Keyboard:isKeyPressed("J")) -- 90
end -- 85
local _with_0 = Node() -- 92
_with_0:schedule(keyboardControl) -- 93
return _with_0 -- 92
Store.keyboardEnabled = false -- 82
local keyboardControl -- 83
keyboardControl = function() -- 83
if not Store.keyboardEnabled then -- 84
return -- 84
end -- 84
updatePlayerControl("keyLeft", Keyboard:isKeyPressed("A")) -- 85
updatePlayerControl("keyRight", Keyboard:isKeyPressed("D")) -- 86
updatePlayerControl("keyUp", Keyboard:isKeyPressed("K")) -- 87
return updatePlayerControl("keyShoot", Keyboard:isKeyPressed("J")) -- 88
end -- 83
local _with_0 = Node() -- 90
_with_0:schedule(keyboardControl) -- 91
return _with_0 -- 90
4 changes: 1 addition & 3 deletions Assets/Script/Game/Zombie Escape/Control.yue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ with AlignNode true
\css "
width: auto;
height: 60;
margin-bottom: 10;
margin-left: 10;
margin-right: 10;
margin: 0, 20, 40;
flex-direction: row;
justify-content: space-between
"
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Game/Zombie Escape/Debug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ local playerChoice = 1 -- 22
local controlChoice -- 23
do -- 23
local _exp_0 = App.platform -- 23
if "iOS" == _exp_0 or "Android" == _exp_0 then -- 24
if "iOS" == _exp_0 or "Android" == _exp_0 or "macOS" == _exp_0 then -- 24
controlChoice = 0 -- 24
else -- 25
controlChoice = 1 -- 25
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Game/Zombie Escape/Debug.yue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ zombieGroup = Group ["zombie", "unit"]
userControl = false
playerChoice = 1
controlChoice = switch App.platform
when "iOS", "Android" then 0
when "iOS", "Android", "macOS" then 0
else 1
camZoom = world.camera.zoom
decisions = []
Expand Down
4 changes: 2 additions & 2 deletions Assets/Script/Test/ExcelTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ ui:addTo(Director.ui)

local bottomAlign = AlignNode()
bottomAlign:css([[
height: 80;
height: 60;
justify-content: space-between;
padding: 0, 20, 20;
margin: 0, 20, 40;
flex-direction: row
]]);
bottomAlign:addTo(ui)
Expand Down
4 changes: 2 additions & 2 deletions Assets/Script/Test/ExcelTest.tl
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ ui:addTo(Director.ui)

local bottomAlign = AlignNode()
bottomAlign:css([[
height: 80;
height: 60;
justify-content: space-between;
padding: 0, 20, 20;
margin: 0, 20, 40;
flex-direction: row
]]);
bottomAlign:addTo(ui)
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Test/ExcelTestTS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ ui:slot( -- 365
) -- 365
ui:addTo(Director.ui) -- 373
local bottomAlign = AlignNode() -- 375
bottomAlign:css("\n\theight: 80;\n\tjustify-content: space-between;\n\tpadding: 0, 20, 20;\n\tflex-direction: row\n") -- 376
bottomAlign:css("\n\theight: 60;\n\tjustify-content: space-between;\n\tmargin: 0, 20, 40;\n\tflex-direction: row\n") -- 376
bottomAlign:addTo(ui) -- 382
local leftAlign = AlignNode() -- 384
leftAlign:css("width: 130; height: 60") -- 385
Expand Down
Loading

0 comments on commit 445b924

Please sign in to comment.