import { delay } from './delay.js' ; import { Laya } from 'Laya.js' ; import { Rectangle } from 'laya/maths/Rectangle.js' ; import { Sprite } from 'laya/display/Sprite.js' ; class Main { constructor ( ) { Laya . init ( 800 , 600 ) ; Laya . stage . screenMode = 'none' ; this . test1 ( ) ; } /**
     */ async test1 ( ) { var sp1 = new Sprite ( ) ; sp1 . graphics . drawRect ( 0 , 0 , 100 , 100 , 'red' ) ; sp1 . pos ( 100 , 100 ) ; sp1 . pivot ( 50 , 50 ) ; sp1 . scrollRect = new Rectangle ( - 50 , - 50 , 80 , 80 ) ; Laya . stage . addChild ( sp1 ) ; var sp2 = new Sprite ( ) ; sp2 . graphics . drawRect ( 100 , 0 , 1 , 100 , 'gray' ) ; sp2 . graphics . drawRect ( 0 , 100 , 100 , 1 , 'gray' ) ; Laya . stage . addChild ( sp2 ) ; await delay ( 10 ) ; ( window as any ) . testEnd = true ; } } new Main ( ) ;