Skip to content

Commit

Permalink
refactor to enhance yue codes readability. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Dec 12, 2023
1 parent e7f94d5 commit 580be20
Show file tree
Hide file tree
Showing 33 changed files with 759 additions and 756 deletions.
4 changes: 2 additions & 2 deletions Assets/Script/Example/Body.yue
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ terrainDef = with BodyDef!
polygonDef = with BodyDef!
.type = "Dynamic"
.linearAcceleration = gravity
\attachPolygon {
\attachPolygon [
Vec2 60, 0
Vec2 30, -30
Vec2 -30, -30
Vec2 -60, 0
Vec2 -30, 30
Vec2 30, 30
}, 1, 0.4, 0.4
], 1, 0.4, 0.4

diskDef = with BodyDef!
.type = "Dynamic"
Expand Down
4 changes: 2 additions & 2 deletions Assets/Script/Example/Contact.yue
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ terrainDef = with BodyDef!
terrain = with Body terrainDef, world
\addTo world

drawNode = with Line {
drawNode = with Line [
Vec2 -20, 0
Vec2 20, 0
Vec2.zero
Vec2 0, -20
Vec2 0, 20
}, App.themeColor
], App.themeColor
\addTo world

diskDef = with BodyDef!
Expand Down
4 changes: 2 additions & 2 deletions Assets/Script/Example/Dorothy Xml.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Node Name="entry">
<Node Name="root">
<Action>
<Spawn Name="rotate">
<Sequence>
Expand Down Expand Up @@ -31,7 +31,7 @@
* "NoFocusOnAppearing"
* "NoNav"
* "NoMove"
entry\schedule ->
root\schedule ->
:width = App.visualSize
ImGui.SetNextWindowBgAlpha 0.35
ImGui.SetNextWindowPos Vec2(width - 10, 10), "Always", Vec2 1,0
Expand Down
4 changes: 2 additions & 2 deletions Assets/Script/Example/DragonBones.yue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ bone = with DragonBone boneStr
\addChild with Label "sarasa-mono-sc-regular", 30
.text = name
.color = App.themeColor
\perform Sequence(Spawn(
\perform Sequence Spawn(
Scale 1, 0, 2, Ease.OutQuad
Sequence(
Delay 0.5
Opacity 0.5, 1, 0
)
), Event "Stop")
), Event "Stop"
.position = Vec2 x, y
.order = 100
\slot "Stop", -> \removeFromParent!
Expand Down
16 changes: 8 additions & 8 deletions Assets/Script/Example/DrawNode.yue
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,38 @@ with Node!
.scaleY = 2
\addChild with DrawNode!
.opacity = 0.5
\drawPolygon {
\drawPolygon [
Vec2 -20, -10
Vec2 20, -10
Vec2 20, 10
Vec2 -20, 10
}
\drawPolygon {
]
\drawPolygon [
Vec2 20, 3
Vec2 32, 10
Vec2 32, -10
Vec2 20, -3
}
]
\drawDot Vec2(-11, 20), 10
\drawDot Vec2(11, 20), 10
\addChild with Line {
\addChild with Line [
Vec2 0, 0
Vec2 40, 0
Vec2 40, 20
Vec2 0, 20
Vec2 0, 0
}
]
.position = Vec2 -20, -10
\addChild with Line CircleVertices 10
.position = Vec2 -21, 10
\addChild with Line CircleVertices 10
.position = Vec2 1, 10
\addChild Line {
\addChild Line [
Vec2 20, 3
Vec2 32, 10
Vec2 32, -10
Vec2 20, -3
}
]

-- example codes ends here, some test ui below --

Expand Down
Loading

0 comments on commit 580be20

Please sign in to comment.