Commit 55809bc8 authored by 李维's avatar 李维

调整文字对齐方式可配置

parent 89550a46
......@@ -1911,7 +1911,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
inputLabel.y = rect.height / 2;
inputLabel.width = rect.width;
inputLabel.height = rect.height;
labelCom.horizontalAlign = 0;
// 文字根据设置是否居左对齐
if(contentData.textAlignLeft) {
labelCom.horizontalAlign = 0;
} else {
labelCom.horizontalAlign = 1;
}
// 超出宽度换行
labelCom.overflow = 3;
currentInputText = text;
......@@ -2039,8 +2045,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
let text = await this.asyncShowKeyboardModal(lastText);
const inputLabel = this.newInputTextNode(text, 0);
const labelCom = inputLabel.getComponent(cc.Label);
inputLabel.x = rect.width / 2;
inputLabel.y = rect.height / 2;
inputLabel.width = rect.width;
inputLabel.height = rect.height;
// 文字根据设置是否居左对齐
if(option.textAlignLeft) {
labelCom.horizontalAlign = 0;
} else {
labelCom.horizontalAlign = 1;
}
// 超出宽度换行
labelCom.overflow = 3;
result.detail.currentInputText = text;
// 更新清除方法
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -449,6 +449,7 @@
<label nz-checkbox [(ngModel)]="data.openAnswer" (ngModelChange)="save()" style="margin-left: 10px;">开放性答案</label>
<label nz-checkbox [(ngModel)]="data.capitalizedFirstLetter" (ngModelChange)="save()" style="margin-left: 10px;">首字母大写</label>
<label nz-checkbox [(ngModel)]="data.notAdaptContraction" (ngModelChange)="save()" style="margin-left: 10px;">不进行缩写适配</label>
<label nz-checkbox [(ngModel)]="data.textAlignLeft" (ngModelChange)="save()" style="margin-left: 10px;">文字靠左对齐</label>
</div>
</td>
<td nzWidth="100px" >
......@@ -513,6 +514,7 @@
<label nz-checkbox [(ngModel)]="it.openAnswer" (ngModelChange)="save()" style="margin-left: 10px;">开放性答案</label>
<label nz-checkbox [(ngModel)]="it.capitalizedFirstLetter" (ngModelChange)="save()" style="margin-left: 10px;">首字母大写</label>
<label nz-checkbox [(ngModel)]="it.notAdaptContraction" (ngModelChange)="save()" style="margin-left: 10px;">不进行缩写适配</label>
<label nz-checkbox [(ngModel)]="it.textAlignLeft" (ngModelChange)="save()" style="margin-left: 10px;">文字靠左对齐</label>
</div>
<div *ngIf="it.hotZoneType != '' && it.hotZoneType != CROSSWORD_PUZZLE && it.hotZoneType != HOT_ZONE_RADIO && it.hotZoneType != HOT_ZONE_CHECKBOX && it.hotZoneType != CONNECTION && it.hotZoneType != TEXT_SELECT && it.hotZoneType != RIGHT_OR_WRONG && it.hotZoneType != TEXTINPUT_GROUP" style="margin: 10px 10px;">
......
......@@ -141,6 +141,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
keyWordMatchInOrder: false,
capitalizedFirstLetter: false,
notAdaptContraction: false,
textAlignLeft: false,
selectOptionList: [
],
......@@ -250,6 +251,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
openAnswer: false, // 开放性答案 [文字输入组]
capitalizedFirstLetter: false, // 首字母大写 [文字输入组]
notAdaptContraction: false, // 不进行缩写适配 [文字输入组]
textAlignLeft: false, // 文字居左对齐 [文字输入组]
}
}
......
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