Egret Engine(二):滚动条配置

阅读 63

2022-07-14


展示

Egret Engine(二):滚动条配置_游戏引擎

配置滚动条代码

const container: egret.DisplayObjectContainer = new egret.DisplayObjectContainer();
this.addChild(container);

const scrollView: egret.ScrollView = new egret.ScrollView();
scrollView.setContent(container);
scrollView.width = this.stage.stageWidth;
scrollView.height = this.stage.stageHeight;
this.addChild(scrollView);

let img = new egret.Bitmap(RES.getRes("bg_jpg"));
container.addChild(img);
img.width = this.stage.stageWidth;
img.height = this.stage.stageHeight * 2;


精彩评论(0)

0 0 举报