Commit 5cd6008f authored by Tt's avatar Tt

增加小点提示

parent 5205da53
{
"ver": "1.1.2",
"uuid": "2bba012f-8712-404a-98ad-4125f95f24b5",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{"name":"tip","version":"5.5","frameRate":24,"isGlobal":0,"armature":[{"name":"Armature","animation":[{"name":"newAnimation","ik":[],"ffd":[],"frame":[],"duration":20,"slot":[{"name":"圆角矩形_30","colorFrame":[{"tweenEasing":0,"color":{"aM":80},"duration":20},{"color":{"aM":0},"duration":0}],"displayFrame":[]},{"name":"圆角矩形_30_拷贝_2","colorFrame":[],"displayFrame":[]}],"bone":[{"name":"root","translateFrame":[],"rotateFrame":[],"scaleFrame":[]},{"name":"圆角矩形_30","translateFrame":[],"rotateFrame":[],"scaleFrame":[{"x":0.73,"duration":20,"tweenEasing":0,"y":0.73},{"duration":0}]}],"playTimes":0}],"bone":[{"name":"root","transform":{}},{"name":"圆角矩形_30","transform":{},"parent":"root"}],"skin":[{"name":"","slot":[{"name":"圆角矩形_30","display":[{"name":"提示/圆角矩形_30","transform":{"skX":-0.0392,"skY":-0.0392},"type":"image","path":"提示/圆角矩形_30"}]},{"name":"圆角矩形_30_拷贝_2","display":[{"name":"提示/圆角矩形_30_拷贝_2","transform":{"skX":-0.1115,"skY":-0.1115},"type":"image","path":"提示/圆角矩形_30_拷贝_2"}]}]}],"defaultActions":[{"gotoAndPlay":"newAnimation"}],"ik":[],"frameRate":24,"slot":[{"name":"圆角矩形_30","color":{},"parent":"圆角矩形_30"},{"name":"圆角矩形_30_拷贝_2","color":{},"z":1,"parent":"root"}],"type":"Armature","aabb":{"x":-51,"height":102,"y":-51,"width":102}}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "a01d1eb2-0b48-4958-91fc-eae82a99bb2d",
"subMetas": {}
}
\ No newline at end of file
{"name":"tip","SubTexture":[{"name":"提示/圆角矩形_30","x":1,"height":102,"y":1,"width":102},{"name":"提示/圆角矩形_30_拷贝_2","x":105,"height":65,"y":1,"width":65}],"height":128,"imagePath":"tip_tex.png","width":256}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "281066f9-a835-4d4b-be1f-94c65e0167e3",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a64effcc-6fa8-45a7-a791-7cafbbb5f43a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 128,
"platformSettings": {},
"subMetas": {
"tip_tex": {
"ver": "1.0.4",
"uuid": "444e67b8-7474-41e4-81fa-5c6c9566d7f0",
"rawTextureUuid": "a64effcc-6fa8-45a7-a791-7cafbbb5f43a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -42.5,
"offsetY": 12,
"trimX": 1,
"trimY": 1,
"width": 169,
"height": 102,
"rawWidth": 256,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
...@@ -67,7 +67,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -67,7 +67,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 初始化页面 // 初始化页面
initView() { initView() {
this.img_dengdai.opacity = 100; this.img_dengdai.opacity = 100;
this.img_dengpao.opacity = 100; this.img_dengpao.opacity = 0;
} }
// 事件监听 // 事件监听
initEvent() { initEvent() {
...@@ -92,7 +92,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -92,7 +92,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node) img_dengdai: cc.Node = null; @property(cc.Node) img_dengdai: cc.Node = null;
initCanvas() { initCanvas() {
this.img_dengdai.opacity = 100; this.img_dengdai.opacity = 100;
this.img_dengpao.opacity = 100; this.img_dengpao.opacity = 0;
let img = pg.view.find(this.layout_canvas, 'img'); let img = pg.view.find(this.layout_canvas, 'img');
pg.view.setNetImg(img, this.currentQuestion.bgItem.url, { w: 1220, h: 790 }, true).then(() => { pg.view.setNetImg(img, this.currentQuestion.bgItem.url, { w: 1220, h: 790 }, true).then(() => {
...@@ -272,13 +272,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -272,13 +272,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
} else { } else {
// 未碰撞到 // 未碰撞到
// 判定碰撞坐标和区域 // 判定碰撞坐标和区域
let targetData = this.checkSuccess(node) let { targetData, targetItem } = this.checkSuccess(node)
if (!targetData) { if (!targetData) {
this.onMeetFail(node); this.onMeetFail(node);
} else { } else {
if (node.data.index != targetData.index) { if (node.data.index != targetData.index) {
this.onMeetFail(node); this.onMeetFail(node);
} else { } else {
targetItem.active = false;
this.onMeetSuccess(node, targetData); this.onMeetSuccess(node, targetData);
} }
} }
...@@ -289,6 +290,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -289,6 +290,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
checkSuccess(node) { checkSuccess(node) {
// 左上角坐标 // 左上角坐标
let targetData = null; let targetData = null;
let targetItem = null;
let minDis = 999999; let minDis = 999999;
let items = this.layout_target.children; let items = this.layout_target.children;
items.forEach((item, i) => { items.forEach((item, i) => {
...@@ -297,9 +299,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -297,9 +299,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (dis < 100 && dis < minDis) { if (dis < 100 && dis < minDis) {
minDis = dis; minDis = dis;
targetData = data; targetData = data;
targetItem = item;
} }
}) })
return targetData return { targetData, targetItem }
} }
private changepoints(data, moveY) { private changepoints(data, moveY) {
...@@ -352,7 +355,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -352,7 +355,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc.Tween.stopAllByTarget(this.img_dengdai) cc.Tween.stopAllByTarget(this.img_dengdai)
cc.Tween.stopAllByTarget(this.img_dengpao) cc.Tween.stopAllByTarget(this.img_dengpao)
this.img_dengdai.opacity = 100; this.img_dengdai.opacity = 100;
this.img_dengpao.opacity = 100; this.img_dengpao.opacity = 0;
this.nextStage(); this.nextStage();
}, 2) }, 2)
} }
......
export const defaultData = export const defaultData =
{"npcTitle":"","npcAudio":"http://teach.cdn.ireadabc.com/ae478b5350293109928af849f41dea0b_l.mp3","npcAudioName":"开始音频.mp3","npcAudioEnd":"http://teach.cdn.ireadabc.com/5c53861a4a8c9bfb7a86453bdcbb23f1_l.mp3","npcAudioEndName":"结束音频.mp3","questions":[{"options":[],"hotZoneFontObj":{"size":50,"name":"BRLNSR_1","color":"#8f3758"},"bgItem":{"url":"http://teach.cdn.ireadabc.com/48ef6e30800733163a3a7e5eee450b9b.png","rect":{"x":175.26254180602007,"y":2.842170943040401e-14,"width":742.4749163879599,"height":443.99999999999994}},"hotZoneItemArr":[{"index":0,"text":"extinction","itemType":"text","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.85390625,"imgScale":1,"mapScale":0.85390625,"rect":{"x":84.24,"y":-32,"width":200,"height":200}},{"index":1,"text":"endangered","itemType":"text","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.85390625,"imgScale":1,"mapScale":0.85390625,"rect":{"x":92.24,"y":55,"width":200,"height":200}},{"index":2,"text":"global warming","itemType":"text","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.85390625,"imgScale":1,"mapScale":0.85390625,"rect":{"x":448.24,"y":-12,"width":200,"height":200}},{"index":3,"text":"threaten","itemType":"text","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.85390625,"imgScale":1,"mapScale":0.85390625,"rect":{"x":439.24,"y":93,"width":200,"height":200}}]}],"bgItem":"","hotZoneItemArr":[]} {"npcTitle":"","npcAudio":"","npcAudioName":"开始音频.mp3","npcAudioEnd":"http://teach.cdn.ireadabc.com/5c53861a4a8c9bfb7a86453bdcbb23f1_l.mp3","npcAudioEndName":"结束音频.mp3","questions":[{"options":[],"hotZoneFontObj":{"size":50,"name":"BRLNSR_1","color":"#8f3758"},"bgItem":{"url":"http://teach.cdn.ireadabc.com/48ef6e30800733163a3a7e5eee450b9b.png","rect":{"x":175.26254180602007,"y":2.842170943040401e-14,"width":742.4749163879599,"height":443.99999999999994}},"hotZoneItemArr":[{"index":0,"text":"extinction","itemType":"text","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.85390625,"imgScale":1,"mapScale":0.85390625,"rect":{"x":84.24,"y":-32,"width":200,"height":200}},{"index":1,"text":"endangered","itemType":"text","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.85390625,"imgScale":1,"mapScale":0.85390625,"rect":{"x":92.24,"y":55,"width":200,"height":200}},{"index":2,"text":"global warming","itemType":"text","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.85390625,"imgScale":1,"mapScale":0.85390625,"rect":{"x":448.24,"y":-12,"width":200,"height":200}},{"index":3,"text":"threaten","itemType":"text","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.85390625,"imgScale":1,"mapScale":0.85390625,"rect":{"x":439.24,"y":93,"width":200,"height":200}}]}],"bgItem":"","hotZoneItemArr":[]}
let mc = { let mc = {
"npcTitle": "exit", "npcAudio": "http://staging-teach.cdn.ireadabc.com/5f4e4c72671607bb35d1ecd1d291f238_l.mp3", "npcTitle": "exit", "npcAudio": "http://staging-teach.cdn.ireadabc.com/5f4e4c72671607bb35d1ecd1d291f238_l.mp3",
"npcAudioName": "boom_dg28_drag.mp3", "npcAudioName": "boom_dg28_drag.mp3",
......
{
"ver": "2.3.5",
"uuid": "d0c26c0f-98dc-4e13-ae28-406585945fa7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 648,
"height": 71,
"platformSettings": {},
"subMetas": {
"img_deng": {
"ver": "1.0.4",
"uuid": "4538a81c-c55d-4bff-b42b-ceaab38cb6fd",
"rawTextureUuid": "d0c26c0f-98dc-4e13-ae28-406585945fa7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 2,
"trimX": 7,
"trimY": 4,
"width": 634,
"height": 59,
"rawWidth": 648,
"rawHeight": 71,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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