import { delay } from './delay.js' ; import { Laya } from 'Laya.js' ; import { Text } from 'laya/display/Text.js' ; import { TextRender } from 'laya/webgl/text/TextRender.js' ; class Main { constructor ( ) { Laya . init ( 800 , 600 ) ; Laya . stage . screenMode = 'none' ; this . test1 ( ) ; } /**
     * 某张文字贴图的一部分被释放后，应该能正确恢复。
     */ async test1 ( ) { var t1 = new Text ( ) ; t1 . fontSize = 120 ; t1 . text = 'abcd' ; t1 . color = 'red' ; Laya . stage . addChild ( t1 ) ; var t2 = new Text ( ) ; t2 . pos ( 0 , 120 ) ; t2 . fontSize = 120 ; t2 . text = 'efgh' ; t2 . color = 'red' ; Laya . stage . addChild ( t2 ) ; await delay ( 10 ) ; t1 . visible = false ; t2 . visible = false ; await delay ( 10 ) ; var t3 = new Text ( ) ; t3 . pos ( 0 , 240 ) ; t3 . text = 'abce' ; t3 . fontSize = 120 ; t3 . color = 'red' ; Laya . stage . addChild ( t3 ) ; await delay ( 10 ) ; TextRender . textRenderInst . GC ( ) ; await delay ( 10 ) ; t1 . visible = true ; await delay ( 10 ) ; ( window as any ) . testEnd = true ; } } new Main ( ) ;