[add] all
This commit is contained in:
18
assets/scripts/horizontal.ts
Normal file
18
assets/scripts/horizontal.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
import BaseItem from './baseItem';
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Horizontal extends BaseItem {
|
||||
onLoad() {
|
||||
this.input.placeholder = this.transform.width.toString()
|
||||
}
|
||||
onInput() {
|
||||
let width = Number(this.input.string)
|
||||
if (isNaN(width)) return
|
||||
if (width < 100) {
|
||||
return
|
||||
}
|
||||
this.transform.setContentSize(new cc.Size(Number(this.input.string), this.transform.height))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user