Commit 00a8b820 authored by 李维's avatar 李维

dev commit

parent 7f59084d
...@@ -355,7 +355,7 @@ export class Cartoon { ...@@ -355,7 +355,7 @@ export class Cartoon {
} }
createCartoonElementShapeRect(id: string, width, height, fillColor = "#FFFF00") { createCartoonElementShapeRect(id: string, width, height, fillColor = "#FFFF00") {
let element = this.createCartoonElement(id, "ShapeRect") let element = this.createCartoonElement(id, "ShapeRectNew")
element.ref.setSize(width, height); element.ref.setSize(width, height);
element.ref.fillColor = fillColor; element.ref.fillColor = fillColor;
return element return element
......
...@@ -407,6 +407,7 @@ export class Label extends MySprite { ...@@ -407,6 +407,7 @@ export class Label extends MySprite {
maxWidth; maxWidth;
outline = 0; outline = 0;
outlineColor = "#ffffff"; outlineColor = "#ffffff";
lineNum = 1;
maxSingalLineWidth = 0; maxSingalLineWidth = 0;
baseY = 0 baseY = 0
...@@ -449,14 +450,14 @@ export class Label extends MySprite { ...@@ -449,14 +450,14 @@ export class Label extends MySprite {
if (testWidth > this.maxSingalLineWidth && n > 0) { if (testWidth > this.maxSingalLineWidth && n > 0) {
// this.ctx.fillText(line, 0, this._warpLineY); // this.ctx.fillText(line, 0, this._warpLineY);
line = words[n] + ' '; line = words[n] + ' ';
// this._warpLineY += this.fontSize; this._warpLineY += this.fontSize;
index++ index++
console.log(index)
height += this.fontSize; height += this.fontSize;
}else { }else {
line = testLine; line = testLine;
} }
} }
this.lineNum = index;
this._height = height; this._height = height;
} }
...@@ -548,6 +549,7 @@ export class Label extends MySprite { ...@@ -548,6 +549,7 @@ export class Label extends MySprite {
var words = this.text.split(' '); var words = this.text.split(' ');
var line = ''; var line = '';
this._warpLineY = 0; this._warpLineY = 0;
let index = 0;
for (var n = 0; n < words.length; n++) { for (var n = 0; n < words.length; n++) {
var testLine = line + words[n] + ' '; var testLine = line + words[n] + ' ';
var metrics = this.ctx.measureText(testLine); var metrics = this.ctx.measureText(testLine);
...@@ -555,13 +557,15 @@ export class Label extends MySprite { ...@@ -555,13 +557,15 @@ export class Label extends MySprite {
if (testWidth > this.maxSingalLineWidth && n > 0) { if (testWidth > this.maxSingalLineWidth && n > 0) {
this.ctx.fillText(line, 0, this._warpLineY); this.ctx.fillText(line, 0, this._warpLineY);
line = words[n] + ' '; line = words[n] + ' ';
this._warpLineY += this.fontSize; index++;
this._warpLineY += this.warpLineHeight?this.warpLineHeight:this.fontSize;
} }
else { else {
line = testLine; line = testLine;
} }
} }
this.y = this.baseY // + this._warpLineY this.lineNum = index;
this.y = this.baseY + this._warpLineY
this.ctx.fillText(line, 0, this._warpLineY); this.ctx.fillText(line, 0, this._warpLineY);
} else { } else {
this.ctx.fillText(this.text, 0, 0); this.ctx.fillText(this.text, 0, 0);
...@@ -602,7 +606,6 @@ export class ShapeRectNew extends MySprite { ...@@ -602,7 +606,6 @@ export class ShapeRectNew extends MySprite {
const width = this.width; const width = this.width;
const height = this.height; const height = this.height;
const radius = this.radius; const radius = this.radius;
ctx.save(); ctx.save();
ctx.beginPath(0); ctx.beginPath(0);
// 从右下角顺时针绘制,弧度从0到1/2PI // 从右下角顺时针绘制,弧度从0到1/2PI
......
This diff is collapsed.
...@@ -46,13 +46,28 @@ const localImages = { ...@@ -46,13 +46,28 @@ const localImages = {
'btn_shift_shadow': 'assets/play/btn_shift_shadow.png', 'btn_shift_shadow': 'assets/play/btn_shift_shadow.png',
'bg_block_right': 'assets/play/bg_block_right.png', 'bg_block_right': 'assets/play/bg_block_right.png',
'bg_block_disable': 'assets/play/bg_block_right_disable.png', 'bg_check_middle': 'assets/play/bg_block_right_disable.png',
'bg_block_init': 'assets/play/bg_block_init.png', 'bg_block_init': 'assets/play/bg_block_init.png',
'bg_block_focus': 'assets/play/bg_block_focus.png', 'bg_block_focus': 'assets/play/bg_block_focus.png',
'bg_block_wrong': 'assets/play/bg_block_wrong.png', 'bg_block_wrong': 'assets/play/bg_block_wrong.png',
'bg_checkboard': 'assets/play/bg_checkboard.png', 'bg_checkboard': 'assets/play/bg_checkboard.png',
'btn_submit': 'assets/play/btn_submit.png', 'btn_submit': 'assets/play/btn_submit.png',
'btn_submit_outline': 'assets/play/btn_submit_outline.png', 'btn_submit_outline': 'assets/play/btn_submit_outline.png',
'bg_check_bottom': 'assets/play/bg_check_bottom.png',
'bg_check_middle': 'assets/play/bg_check_middle.png',
'bg_check_middle_mask': 'assets/play/bg_check_middle_mask.png',
'bg_check_top': 'assets/play/bg_check_top.png',
'check_bottom': 'assets/play/check_bottom.png',
'check_middle': 'assets/play/check_middle.png',
'check_top': 'assets/play/check_top.png',
'check_pannel_split_line': 'assets/play/check_pannel_split_line.png',
'bg_wrong_ans': 'assets/play/bg_wrong_ans.png',
'bgSlider': 'assets/play/bgSlider.png',
'slider_top': 'assets/play/slider_top.png',
'slider_body': 'assets/play/slider_body.png',
'slider_bottom': 'assets/play/slider_bottom.png'
}; };
const localAudios = { const localAudios = {
......
src/assets/play/bgSlider.png

1.82 KB | W: | H:

src/assets/play/bgSlider.png

1.96 KB | W: | H:

src/assets/play/bgSlider.png
src/assets/play/bgSlider.png
src/assets/play/bgSlider.png
src/assets/play/bgSlider.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/bg_check_bottom.png

114 KB | W: | H:

src/assets/play/bg_check_bottom.png

114 KB | W: | H:

src/assets/play/bg_check_bottom.png
src/assets/play/bg_check_bottom.png
src/assets/play/bg_check_bottom.png
src/assets/play/bg_check_bottom.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/bg_check_middle.png

331 KB | W: | H:

src/assets/play/bg_check_middle.png

331 KB | W: | H:

src/assets/play/bg_check_middle.png
src/assets/play/bg_check_middle.png
src/assets/play/bg_check_middle.png
src/assets/play/bg_check_middle.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/bg_check_top.png

107 KB | W: | H:

src/assets/play/bg_check_top.png

107 KB | W: | H:

src/assets/play/bg_check_top.png
src/assets/play/bg_check_top.png
src/assets/play/bg_check_top.png
src/assets/play/bg_check_top.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/bg_wrong_ans.png

784 Bytes | W: | H:

src/assets/play/bg_wrong_ans.png

5.29 KB | W: | H:

src/assets/play/bg_wrong_ans.png
src/assets/play/bg_wrong_ans.png
src/assets/play/bg_wrong_ans.png
src/assets/play/bg_wrong_ans.png
  • 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