Commit c1cfdace authored by Seaborn Lee's avatar Seaborn Lee

style: 初始化背景

parent db8fffe1
...@@ -491,12 +491,26 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -491,12 +491,26 @@ export class PlayComponent implements OnInit, OnDestroy {
* 初始化试图 * 初始化试图
*/ */
initView() { initView() {
this.initBg();
// initSmallBg();
// initAudioPlayer();
this.initPic(); // this.initPic();
this.initBottomPart(); // this.initBottomPart();
}
private initBg() {
const pic = new MySprite();
pic.init(this.images.get('bg'));
pic.x = this.canvasWidth / 2;
const scaleX = this.canvasWidth / pic.width;
const scaleY = this.canvasHeight / pic.height;
const scale = Math.max(scaleX, scaleY);
pic.setScaleXY(scale);
pic.y = this.canvasHeight - pic.height / 2 * scale;
this.renderArr.push(pic);
} }
initBottomPart() { initBottomPart() {
......
const res = [ const res = [
// ['bg', "assets/play/bg.jpg"], ['bg', "assets/play/bg.jpg"],
['btn_left', "assets/play/btn_left.png"], ['btn_left', "assets/play/btn_left.png"],
['btn_right', "assets/play/btn_right.png"], ['btn_right', "assets/play/btn_right.png"],
// ['text_bg', "assets/play/text_bg.png"], // ['text_bg', "assets/play/text_bg.png"],
......
src/assets/play/bg.jpg

25.8 KB | W: | H:

src/assets/play/bg.jpg

408 KB | W: | H:

src/assets/play/bg.jpg
src/assets/play/bg.jpg
src/assets/play/bg.jpg
src/assets/play/bg.jpg
  • 2-up
  • Swipe
  • Onion skin
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