Commit 07320d5e authored by 李维's avatar 李维

Merge branch 'master' of http://vcs.ireadabc.com/template/YM4-13

parents 57043176 47a7a43b
...@@ -193,7 +193,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy { ...@@ -193,7 +193,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy {
item.x = saveRect.x / saveData.scale + newRect.x item.x = saveRect.x / saveData.scale + newRect.x
item.y = saveRect.y / saveData.scale + newRect.y item.y = saveRect.y / saveData.scale + newRect.y
if(saveData.media.type == "Text") { if(saveData.media.type == "Text") {
return {width: this.itemWidth, height: this.itemHeight} return {width: this.itemWidth, height: this.itemHeight}
} }
}); });
...@@ -204,7 +203,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy { ...@@ -204,7 +203,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy {
item.audio_url = saveData.media.audio_url?saveData.media.audio_url:"" item.audio_url = saveData.media.audio_url?saveData.media.audio_url:""
} else { } else {
item.uid = uuid.v4() item.uid = uuid.v4()
item.initFont(Number(this.fontSize) * this.scale, this.fontName, this.fontColor) item.initFont(this.fontSize, this.fontName, this.fontColor)
item.init(this.defaultItemBG, "Text", "Text", () => { item.init(this.defaultItemBG, "Text", "Text", () => {
item.x = this.canvasWidth / 2 - this.itemWidth / 2; item.x = this.canvasWidth / 2 - this.itemWidth / 2;
item.y = this.canvasHeight / 2 - 20; item.y = this.canvasHeight / 2 - 20;
......
...@@ -23,8 +23,9 @@ ...@@ -23,8 +23,9 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div class="section" style="display: flex; padding: 1rem;"> <div class="section" style="padding: 1rem;">
<!-- 左侧选区 --> <nz-collapse>
<nz-collapse-panel nzHeader="左选区" nzActive="true">
<div style="flex: 1; padding-right: 20px;"> <div style="flex: 1; padding-right: 20px;">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4">左侧单词</nz-form-label> <nz-form-label [nzSpan]="4">左侧单词</nz-form-label>
...@@ -43,14 +44,13 @@ ...@@ -43,14 +44,13 @@
[customBackground] = "true" [customBackground] = "true"
defaultBGImage = "assets/play/bg_330_168.png" defaultBGImage = "assets/play/bg_330_168.png"
defaultItemBG = "assets/play/default_itemBG.png" defaultItemBG = "assets/play/default_itemBG.png"
[itemWidth] = "100" [itemWidth] = "240"
[itemHeight] = "43" [itemHeight] = "114"
[bgItem]="bgItemLeft" [bgItem]="bgItemLeft"
fontSize = "48" fontSize = "48"
fontName = "FuturaBT-Medium" fontName = "FuturaBT-Medium"
fontColor = "#c8161e" fontColor = "#c8161e"
[hotZoneItemArr]="hotZoneItemArrLeft" [hotZoneItemArr]="hotZoneItemArrLeft"
title="左选区"
(save)="saveData($event, 1)" (save)="saveData($event, 1)"
></app-custom-hot-zone> ></app-custom-hot-zone>
...@@ -171,8 +171,9 @@ ...@@ -171,8 +171,9 @@
</nz-form-item> </nz-form-item>
</div> </div>
</div> </div>
</nz-collapse-panel>
<!-- 中间选区 --> <nz-collapse-panel nzHeader="中选区" nzActive="false">
<div style="flex: 1; padding-left: 20px; border-left: 2px dashed #ccc;"> <div style="flex: 1; padding-left: 20px; border-left: 2px dashed #ccc;">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4">中间单词</nz-form-label> <nz-form-label [nzSpan]="4">中间单词</nz-form-label>
...@@ -192,14 +193,13 @@ ...@@ -192,14 +193,13 @@
[customBackground] = "true" [customBackground] = "true"
defaultBGImage = "assets/play/bg_330_168.png" defaultBGImage = "assets/play/bg_330_168.png"
defaultItemBG = "assets/play/default_itemBG.png" defaultItemBG = "assets/play/default_itemBG.png"
[itemWidth] = "100" [itemWidth] = "240"
[itemHeight] = "43" [itemHeight] = "114"
[(bgItem)]="bgItemMiddle" [(bgItem)]="bgItemMiddle"
fontSize = "48" fontSize = "48"
fontName = "FuturaBT-Medium" fontName = "FuturaBT-Medium"
fontColor = "#c8161e" fontColor = "#c8161e"
[(hotZoneItemArr)]="hotZoneItemArrMiddle" [(hotZoneItemArr)]="hotZoneItemArrMiddle"
title="右选区"
(save)="saveData($event, 2)" (save)="saveData($event, 2)"
></app-custom-hot-zone> ></app-custom-hot-zone>
...@@ -320,9 +320,9 @@ ...@@ -320,9 +320,9 @@
</nz-form-item> </nz-form-item>
</div> </div>
</div> </div>
</nz-collapse-panel>
<nz-collapse-panel nzHeader="右选区" nzActive="false">
<!-- 右侧选区 -->
<div style="flex: 1; padding-left: 20px; border-left: 2px dashed #ccc;"> <div style="flex: 1; padding-left: 20px; border-left: 2px dashed #ccc;">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4">右侧单词</nz-form-label> <nz-form-label [nzSpan]="4">右侧单词</nz-form-label>
...@@ -342,14 +342,13 @@ ...@@ -342,14 +342,13 @@
[customBackground] = "true" [customBackground] = "true"
defaultBGImage = "assets/play/bg_330_168.png" defaultBGImage = "assets/play/bg_330_168.png"
defaultItemBG = "assets/play/default_itemBG.png" defaultItemBG = "assets/play/default_itemBG.png"
[itemWidth] = "100" [itemWidth] = "240"
[itemHeight] = "43" [itemHeight] = "114"
[(bgItem)]="bgItemRight" [(bgItem)]="bgItemRight"
fontSize = "48" fontSize = "48"
fontName = "FuturaBT-Medium" fontName = "FuturaBT-Medium"
fontColor = "#c8161e" fontColor = "#c8161e"
[(hotZoneItemArr)]="hotZoneItemArrRight" [(hotZoneItemArr)]="hotZoneItemArrRight"
title="右选区"
(save)="saveData($event, 3)" (save)="saveData($event, 3)"
></app-custom-hot-zone> ></app-custom-hot-zone>
...@@ -470,6 +469,8 @@ ...@@ -470,6 +469,8 @@
</nz-form-item> </nz-form-item>
</div> </div>
</div> </div>
</nz-collapse-panel>
</nz-collapse>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -466,7 +466,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -466,7 +466,7 @@ export class PlayComponent implements OnInit, OnDestroy {
containerMiddle.ref.addChild(element_middle.ref) containerMiddle.ref.addChild(element_middle.ref)
this.render(containerMiddle.ref) this.render(containerMiddle.ref)
this.initHotZooes(this.g_formData.hotZoneItemArrRight, containerMiddle, "middle") this.initHotZooes(this.g_formData.hotZoneItemArrMiddle, containerMiddle, "middle")
// 右侧 // 右侧
let containerRight = this.g_cartoon.createCartoonElementImageFunc("select-container-right", "bg_330_168", (w, h)=>{ let containerRight = this.g_cartoon.createCartoonElementImageFunc("select-container-right", "bg_330_168", (w, h)=>{
...@@ -513,6 +513,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -513,6 +513,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let element = null let element = null
element = this.g_cartoon.createCartoonElement("image-puzzle-"+index+"_"+side, "MySprite") element = this.g_cartoon.createCartoonElement("image-puzzle-"+index+"_"+side, "MySprite")
console.log(item.media.image_url)
element.ref.init(this.g_cartoon.images.get(item.media.image_url)) element.ref.init(this.g_cartoon.images.get(item.media.image_url))
element.ref.scaleX = (item.rect.width / element.ref.width) * parent.ref.scaleX element.ref.scaleX = (item.rect.width / element.ref.width) * parent.ref.scaleX
element.ref.scaleY = (item.rect.height / element.ref.height) * parent.ref.scaleY element.ref.scaleY = (item.rect.height / element.ref.height) * parent.ref.scaleY
......
src/assets/play/default_itemBG.png

1.7 KB | W: | H:

src/assets/play/default_itemBG.png

2.12 KB | W: | H:

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