Commit 8f2961c4 authored by 李维's avatar 李维

设置文字选项文本换行

parent be56686a
...@@ -3590,8 +3590,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -3590,8 +3590,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
let selectData = await this.asyncShowSelectModal(optionList, "textList", contentData.oplistCol2?true:false); let selectData = await this.asyncShowSelectModal(optionList, "textList", contentData.oplistCol2?true:false);
// 如果点击了取消 则还原上次显示 // 如果点击了取消 则还原上次显示
const inputLabel = this.newInputTextNode(selectData?selectData.value:lastText, 0); const inputLabel = this.newInputTextNode(selectData?selectData.value:lastText, 0);
const labelCom = inputLabel.getComponent(cc.Label);
inputLabel.x = rect.width / 2; inputLabel.x = rect.width / 2;
inputLabel.y = rect.height / 2; inputLabel.y = rect.height / 2;
inputLabel.width = rect.width;
inputLabel.height = rect.height;
labelCom.horizontalAlign = 1;
// 超出宽度换行
labelCom.overflow = 3;
// 如果选择了数据 并且 选择的选项是配置了划线的 则显示划线 并把引用加1 // 如果选择了数据 并且 选择的选项是配置了划线的 则显示划线 并把引用加1
if(selectData && selectData.strikeOutNode) { if(selectData && selectData.strikeOutNode) {
...@@ -3778,8 +3784,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -3778,8 +3784,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
const inputLabel = this.newInputTextNode(showLabel, 0); const inputLabel = this.newInputTextNode(showLabel, 0);
const labelCom = inputLabel.getComponent(cc.Label);
inputLabel.x = rect.width / 2; inputLabel.x = rect.width / 2;
inputLabel.y = rect.height / 2; inputLabel.y = rect.height / 2;
inputLabel.width = rect.width;
inputLabel.height = rect.height;
labelCom.horizontalAlign = 1;
// 超出宽度换行
labelCom.overflow = 3;
// 更新清除方法 // 更新清除方法
rect.cleanLast = () => { rect.cleanLast = () => {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment