Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP72
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
OP72
Commits
553e3a9d
Commit
553e3a9d
authored
Nov 11, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
14fb643f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
321 additions
and
170 deletions
+321
-170
OP72.fire
assets/OP72/scene/OP72.fire
+252
-159
OP72.js
assets/OP72/scene/OP72.js
+32
-11
util.js
assets/OP72/script/util.js
+1
-0
panel.png
assets/OP72/texture/panel.png
+0
-0
panel.png.meta
assets/OP72/texture/panel.png.meta
+36
-0
No files found.
assets/OP72/scene/OP72.fire
View file @
553e3a9d
This diff is collapsed.
Click to expand it.
assets/OP72/scene/OP72.js
View file @
553e3a9d
...
...
@@ -488,7 +488,9 @@ cc.Class({
this
.
playCatAudio
(
this
.
data
.
begin_audio_url
,
()
=>
{
this
.
canTouch
=
true
;
// this.isPanelMoveEnd = true;
this
.
startTesting
();
this
.
catBeginEnd
=
true
;
this
.
checkStart
();
});
this
.
curCatAudioUrl
=
this
.
data
.
idle_audio_url
;
...
...
@@ -603,7 +605,7 @@ cc.Class({
checkStart
()
{
console
.
log
(
'
in checkStart
'
)
if
(
this
.
debugBgImg
&&
this
.
hzLoadEnd
)
{
if
(
this
.
debugBgImg
&&
this
.
hzLoadEnd
&&
this
.
catBeginEnd
)
{
this
.
startTesting
();
}
...
...
@@ -5762,7 +5764,7 @@ cc.Class({
initBg
()
{
console
.
log
(
"
this.data.bg_pic_url:
"
,
this
.
data
.
bg_pic_url
);
const
bg
=
getSprNode
(
'
bg
'
);
const
scaleX
=
this
.
canvas
.
width
/
bg
.
width
const
scaleY
=
this
.
canvas
.
height
/
bg
.
height
...
...
@@ -5781,7 +5783,6 @@ cc.Class({
hotZoneBg
:
null
,
initHotZoneBg
()
{
this
.
hotZoneBg
=
new
cc
.
Node
();
this
.
hotZoneBg
.
name
=
'
hotZoneBg
'
;
this
.
hotZoneBg
.
parent
=
cc
.
find
(
'
Canvas
'
);
this
.
hotZoneBg
.
zIndex
=
4
;
...
...
@@ -5798,7 +5799,6 @@ cc.Class({
this
.
hotZoneBg
.
height
=
img
.
height
;
const
sprNode
=
new
cc
.
Node
();
sprNode
.
name
=
'
bgItemSpr
'
var
sf
=
new
cc
.
SpriteFrame
(
img
);
...
...
@@ -5811,19 +5811,40 @@ cc.Class({
window
[
'
bg
'
]
=
sprNode
const
sx
=
this
.
canvas
.
width
/
this
.
hotZoneBg
.
width
;
const
sy
=
(
this
.
canvas
.
height
)
/
this
.
hotZoneBg
.
height
;
// const sx = this.canvas.width / this.hotZoneBg.width;
// const sy = (this.canvas.height) / this.hotZoneBg.height;
// const s = Math.min(sx, sy);
// this.hotZoneBg.scale = s;
const
panel
=
getSprNode
(
'
panel
'
);
panel
.
scale
=
this
.
_mapScaleMin
*
1.5
;
this
.
canvas
.
addChild
(
panel
);
panel
.
x
=
-
this
.
canvas
.
width
;
const
parent
=
panel
;
const
sx
=
parent
.
width
/
this
.
hotZoneBg
.
width
;
const
sy
=
parent
.
height
/
this
.
hotZoneBg
.
height
;
const
s
=
Math
.
min
(
sx
,
sy
);
this
.
hotZoneBg
.
scale
=
s
;
this
.
hotZoneBg
.
scale
=
s
*
0.9
;
this
.
hotZoneBg
.
parent
=
panel
;
// this.data.bgItem.isShowDebugLine = true;
this
.
initHotZoneItem
();
this
.
hzLoadEnd
=
true
;
this
.
checkStart
();
cc
.
tween
(
panel
)
.
to
(
1
,
{
x
:
0
},
{
easing
:
'
cubicOut
'
})
.
call
(()
=>
{
this
.
hzLoadEnd
=
true
;
this
.
checkStart
();
})
.
start
();
});
},
...
...
assets/OP72/script/util.js
View file @
553e3a9d
...
...
@@ -81,6 +81,7 @@ export function getSpriteFrimeByUrl(url, cb) {
}
export
function
getSprNode
(
resName
)
{
console
.
log
(
'
getSprNode name:
'
,
resName
);
const
sf
=
cc
.
find
(
'
Canvas/res/img/
'
+
resName
).
getComponent
(
cc
.
Sprite
).
spriteFrame
;
const
node
=
new
cc
.
Node
();
node
.
addComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
...
...
assets/OP72/texture/panel.png
0 → 100644
View file @
553e3a9d
11.8 KB
assets/OP72/texture/panel.png.meta
0 → 100644
View file @
553e3a9d
{
"ver": "2.3.5",
"uuid": "bb7834e2-2860-44ab-b61a-7cbb95e196eb",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 900,
"height": 510,
"platformSettings": {},
"subMetas": {
"panel": {
"ver": "1.0.4",
"uuid": "3e3af191-f7fb-4e1d-9de3-c629f1af6da3",
"rawTextureUuid": "bb7834e2-2860-44ab-b61a-7cbb95e196eb",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 900,
"height": 510,
"rawWidth": 900,
"rawHeight": 510,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment