Commit 788b31e9 authored by yu's avatar yu

1

parent 2d362bb8
......@@ -286,6 +286,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
this.playLocalAudio("right");
if (question.type == "txt") {
this.addTxteImg(item);
cc.tween(target).to(0.5, { scale: 1.2 }).to(0.2, { scale: 0.5 }).call(() => {
this.wordRight(item).then(() => {
this.hideTop(card);
......@@ -307,6 +308,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
}).start();
}
private addTxteImg(item) {
let node = new cc.Node();
node.addComponent(cc.Sprite);
pg.view.setNetImg(node, this.cardInfo.picUrl, { w: 110, h: 114 });
let layout_img = cc.find("layout_img", item);
node.parent = layout_img;
let scale = layout_img.parent.scale
node.scale = scale < 0.9 ? 0.9 : scale;
}
private wordRight(item) {
return new Promise((resolve, reject) => {
let layout_word = cc.find("layout_word", item);
......
......@@ -19,42 +19,42 @@ export const defaultData = {
{
"type": "img",
"text": "1",
"image": "",
"image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "",
"idx": "1"
},
{
"type": "txt",
"text": "1",
"image": "",
"image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "",
"idx": "1"
},
{
"type": "txt",
"text": "2",
"image": "",
"image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "",
"idx": "2"
},
{
"type": "txt",
"text": "3",
"image": "",
"image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "",
"idx": "3"
},
{
"type": "txt",
"text": "2",
"image": "",
"image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "",
"idx": "2"
},
{
"type": "txt",
"text": "4",
"image": "",
"image": "http://staging-teach.cdn.ireadabc.com/5835aa41da46fd1e9d3aab12e8510051.png",
"audio": "",
"idx": "4"
}
......
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