update text demo

This commit is contained in:
王劲鹏 2021-07-19 17:08:45 +08:00 committed by osborn
parent a1240cfa2e
commit c877a72c80

View File

@ -41,7 +41,7 @@ class TextDemo extends Panel {
hlayout([ hlayout([
text({ text({
text: "T_B", text: "T_B",
textSize: 80, textSize: 60,
textColor: { textColor: {
start: Color.RED, start: Color.RED,
end: Color.GREEN, end: Color.GREEN,
@ -49,30 +49,12 @@ class TextDemo extends Panel {
} }
}), }),
text({ text({
text: "TR_BL", text: "B_T",
textSize: 80, textSize: 60,
textColor: { textColor: {
start: Color.RED, start: Color.RED,
end: Color.GREEN, end: Color.GREEN,
orientation: GradientOrientation.TR_BL, orientation: GradientOrientation.BOTTOM_TOP,
}
}),
text({
text: "R_L",
textSize: 80,
textColor: {
start: Color.RED,
end: Color.GREEN,
orientation: GradientOrientation.RIGHT_LEFT,
}
}),
text({
text: "BR_TL",
textSize: 80,
textColor: {
start: Color.RED,
end: Color.GREEN,
orientation: GradientOrientation.BR_TL,
} }
}), }),
], { ], {
@ -80,35 +62,61 @@ class TextDemo extends Panel {
}), }),
hlayout([ hlayout([
text({ text({
text: "B_T", text: "TR_BL",
textSize: 80, textSize: 60,
textColor: { textColor: {
start: Color.RED, start: Color.RED,
end: Color.GREEN, end: Color.GREEN,
orientation: GradientOrientation.BOTTOM_TOP, orientation: GradientOrientation.TR_BL,
} }
}), }),
text({ text({
text: "BL_TR", text: "BL_TR",
textSize: 80, textSize: 60,
textColor: { textColor: {
start: Color.RED, start: Color.RED,
end: Color.GREEN, end: Color.GREEN,
orientation: GradientOrientation.BL_TR, orientation: GradientOrientation.BL_TR,
} }
}), }),
], {
space: 20
}),
hlayout([
text({
text: "R_L",
textSize: 60,
textColor: {
start: Color.RED,
end: Color.GREEN,
orientation: GradientOrientation.RIGHT_LEFT,
}
}),
text({ text({
text: "L_R", text: "L_R",
textSize: 80, textSize: 60,
textColor: { textColor: {
start: Color.RED, start: Color.RED,
end: Color.GREEN, end: Color.GREEN,
orientation: GradientOrientation.LEFT_RIGHT, orientation: GradientOrientation.LEFT_RIGHT,
} }
}), }),
], {
space: 20
}),
hlayout([
text({
text: "BR_TL",
textSize: 60,
textColor: {
start: Color.RED,
end: Color.GREEN,
orientation: GradientOrientation.BR_TL,
}
}),
text({ text({
text: "TL_BR", text: "TL_BR",
textSize: 80, textSize: 60,
textColor: { textColor: {
start: Color.RED, start: Color.RED,
end: Color.GREEN, end: Color.GREEN,
@ -120,7 +128,7 @@ class TextDemo extends Panel {
}), }),
text({ text({
text: "grad", text: "grad",
textSize: 120, textSize: 100,
textColor: { textColor: {
colors: [Color.GREEN, Color.WHITE, Color.RED], colors: [Color.GREEN, Color.WHITE, Color.RED],
locations: [0, 0.5, 1], locations: [0, 0.5, 1],