Commit 65e64cb2 authored by limingzhe's avatar limingzhe

update

parent 20da4385
......@@ -71,6 +71,9 @@ export class FormComponent implements OnInit, OnChanges {
// }
this.item = {};
this.item.contentObj = {};
const getData = (<any> window).courseware.getData;
getData((data) => {
......@@ -84,7 +87,7 @@ export class FormComponent implements OnInit, OnChanges {
console.log('data:', data);
// this.init();
// this.refresh();
this.refresh();
}, this.KEY);
......
......@@ -13,16 +13,17 @@
@font-face
{
font-family: 'BRLNSDB_1';
src: url("/assets/font/BRLNSDB_1.TTF") format("opentype");
src: url("../../assets/font/BRLNSDB_1.TTF") format("opentype");
}
@font-face
{
font-family: 'CooperBlackStd';
src: url("/assets/font/CooperBlackStd.otf") format("opentype");
src: url("../../assets/font/CooperBlackStd.otf") format("opentype");
}
......@@ -78,6 +78,8 @@ export class PlayComponent implements OnInit, OnDestroy {
// ------
KEY = 'dfzx_04';
unitLabel;
titleLabel;
bottomArr = [];
......@@ -306,7 +308,7 @@ export class PlayComponent implements OnInit, OnDestroy {
initDefaultData() {
if (!this.data.contentObj.unit) {
this.data.contentObj.unit = 'unit 1';
this.data.contentObj.unit = 'Unit 1';
}
if (!this.data.contentObj.title) {
this.data.contentObj.title = 'Hello';
......@@ -351,9 +353,33 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initTitle();
this.initLogo();
this.showAnima();
// this.initItem();
}
showAnima() {
this.unitLabel.alpha = 0;
this.unitLabel.bg.alpha = 0;
this.titleLabel.y = -this.titleLabel.fontSize;
const showUnit = () => {
tweenChange(this.unitLabel, {alpha: 1}, 0.7, null, TWEEN.Easing.Cubic.Out, (item, progress) => {
this.unitLabel.bg.alpha = this.unitLabel.alpha;
});
};
const showTitle = () => {
moveItem(this.titleLabel, this.titleLabel.x, this.titleLabel.baseY, 1, () => {
showUnit();
}, TWEEN.Easing.Bounce.Out);
};
showTitle();
}
initBg() {
this.bottomArr = [];
......@@ -400,9 +426,13 @@ export class PlayComponent implements OnInit, OnDestroy {
label.textAlign = 'center';
label.x = this.canvasWidth / 2;
label.y = y * this.mapScale;
label['bg'] = labelBg;
this.renderArr.push(labelBg);
this.renderArr.push(label);
this.unitLabel = label;
}
......@@ -434,20 +464,25 @@ export class PlayComponent implements OnInit, OnDestroy {
titleText.disH = (10) * this.mapScale;
titleText.fontColor = '#ffffff';
titleText.fontName = 'CooperBlackStd';
// titleText.fontName = 'Verdana';
titleText.textAlign = 'center';
titleText.text = this.data.contentObj.title;
titleText.y = this.canvasHeight / 2 - titleText.fontSize / 2 - this.canvasHeight / 15; // * this.mapScale - titleText.fontSize * this.mapScale; // - titleText.textH - titleText.fontSize;
// titleText.setScaleXY(this.mapScale);
titleText.width = this.canvasWidth / 1.6;
// titleText.fontWeight = 900;
titleText.setOutline(20, '#ff7600');
titleText.x = this.canvasWidth / 2; // - titleText.width * titleText.scaleX / 2;
titleText['baseY'] = titleText.y;
// this.titleText = titleText;
this.renderArr.push(titleText);
this.titleLabel = titleText;
}
......@@ -459,8 +494,8 @@ export class PlayComponent implements OnInit, OnDestroy {
}
const logoW = 320;
const logoH = 220;
const logoW = 320 * this.mapScale;
const logoH = 220 * this.mapScale;
const offSet = 20 * this.mapScale;
......
......@@ -3,6 +3,9 @@ const res = [
['bg', "assets/play/bg.jpg"],
['logo', "assets/default/logo.png"],
// ['font_1', "assets/font/BRLNSDB_1.TTF"],
// ['font_2', "assets/font/CooperBlackStd.otf"],
......
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