Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Coloring
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
Coloring
Commits
39292dd9
Commit
39292dd9
authored
Mar 25, 2022
by
张世斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修复bug
parent
8c276589
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1384 additions
and
543 deletions
+1384
-543
LayerMgr.ts
assets/Coloring/script/Core/Manager/LayerMgr.ts
+35
-3
MenuController.ts
assets/Coloring/script/Game/MenuController.ts
+5
-1
MenuModel.ts
assets/Coloring/script/Game/MenuModel.ts
+2
-1
buildCocos.js
bin/buildCocos.js
+3
-0
package-lock.json
package-lock.json
+787
-1
yarn.lock
yarn.lock
+552
-537
No files found.
assets/Coloring/script/Core/Manager/LayerMgr.ts
View file @
39292dd9
...
@@ -88,9 +88,10 @@ export default class LayerMgr extends Manager {
...
@@ -88,9 +88,10 @@ export default class LayerMgr extends Manager {
// cc.view.setFrameSize(screen.width*0.5,screen.height*0.5)
// cc.view.setFrameSize(screen.width*0.5,screen.height*0.5)
//手机设备和pc返回的不一样【神经病,pc返回width/height,应该是height/widg】
//手机设备和pc返回的不一样【神经病,pc返回width/height,应该是height/widg】
//let cRatio=cc.view.getDevicePixelRatio()
//let cRatio=cc.view.getDevicePixelRatio()
let
policy
=
this
.
isFitWidth
()
&&
cc
.
ResolutionPolicy
.
FIXED_WIDTH
||
cc
.
ResolutionPolicy
.
FIXED_HEIGHT
// let policy = this.isFitWidth() && cc.ResolutionPolicy.FIXED_WIDTH || cc.ResolutionPolicy.FIXED_HEIGHT
// cc.view.setDesignResolutionSize(720, 1280, policy)
// // cc.view.setDesignResolutionSize(720, 1280, policy)
cc
.
view
.
setDesignResolutionSize
(
AppConst
.
Width
,
AppConst
.
Height
,
policy
)
// cc.view.setDesignResolutionSize(AppConst.Width, AppConst.Height, policy)
this
.
initSize
();
this
.
layers
=
new
Array
()
this
.
layers
=
new
Array
()
this
.
createLayers
()
this
.
createLayers
()
...
@@ -98,6 +99,37 @@ export default class LayerMgr extends Manager {
...
@@ -98,6 +99,37 @@ export default class LayerMgr extends Manager {
this
.
uiViews
=
[
this
.
flybllodLayer
,
this
.
uiLayer
,
this
.
windowLayer
,
this
.
windowTopLayer
,
this
.
tipViewLayer
,
this
.
guideLayer
,
this
.
topLayer
]
this
.
uiViews
=
[
this
.
flybllodLayer
,
this
.
uiLayer
,
this
.
windowLayer
,
this
.
windowTopLayer
,
this
.
tipViewLayer
,
this
.
guideLayer
,
this
.
topLayer
]
console
.
log
(
"
LayerMgr onStart
"
)
console
.
log
(
"
LayerMgr onStart
"
)
}
}
_designSize
=
null
;
// 设计分辨率
_frameSize
=
null
;
// 屏幕分辨率
_mapScaleMin
=
null
;
// 场景中常用缩放(取大值)
_mapScaleMax
=
null
;
// 场景中常用缩放(取小值)
_cocosScale
=
null
;
// cocos 自缩放 (较少用到)
initSize
()
{
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
let
screen_size
=
cc
.
view
.
getFrameSize
().
width
/
cc
.
view
.
getFrameSize
().
height
let
design_size
=
cc
.
Canvas
.
instance
.
designResolution
.
width
/
cc
.
Canvas
.
instance
.
designResolution
.
height
let
f
=
screen_size
>=
design_size
cc
.
Canvas
.
instance
.
fitHeight
=
f
cc
.
Canvas
.
instance
.
fitWidth
=
!
f
const
frameSize
=
cc
.
view
.
getFrameSize
();
this
.
_frameSize
=
frameSize
;
this
.
_designSize
=
cc
.
view
.
getDesignResolutionSize
();
let
sx
=
cc
.
winSize
.
width
/
frameSize
.
width
;
let
sy
=
cc
.
winSize
.
height
/
frameSize
.
height
;
this
.
_cocosScale
=
Math
.
min
(
sx
,
sy
);
sx
=
frameSize
.
width
/
this
.
_designSize
.
width
;
sy
=
frameSize
.
height
/
this
.
_designSize
.
height
;
this
.
_mapScaleMin
=
Math
.
min
(
sx
,
sy
)
*
this
.
_cocosScale
;
this
.
_mapScaleMax
=
Math
.
max
(
sx
,
sy
)
*
this
.
_cocosScale
;
cc
.
director
[
'
_scene
'
].
width
=
frameSize
.
width
;
cc
.
director
[
'
_scene
'
].
height
=
frameSize
.
height
;
}
public
release
()
{
public
release
()
{
console
.
log
(
"
LayerMgr onRelease
"
)
console
.
log
(
"
LayerMgr onRelease
"
)
...
...
assets/Coloring/script/Game/MenuController.ts
View file @
39292dd9
...
@@ -124,6 +124,9 @@ export default class MenuController extends Controller{
...
@@ -124,6 +124,9 @@ export default class MenuController extends Controller{
}
}
private
onClickColor
(
node
:
cc
.
Node
){
private
onClickColor
(
node
:
cc
.
Node
){
if
(
!
this
.
isCanTap
){
return
;
}
let
choice
=
this
.
view
.
choiceColor
;
let
choice
=
this
.
view
.
choiceColor
;
choice
.
active
=
true
;
choice
.
active
=
true
;
choice
.
x
=
node
.
x
;
choice
.
x
=
node
.
x
;
...
@@ -154,6 +157,7 @@ export default class MenuController extends Controller{
...
@@ -154,6 +157,7 @@ export default class MenuController extends Controller{
this
.
playDragonBoneAnimation
(
this
.
catAni
,
"
finish
"
,
1
,()
=>
{
this
.
playDragonBoneAnimation
(
this
.
catAni
,
"
finish
"
,
1
,()
=>
{
this
.
playDragonBoneAnimation
(
this
.
catAni
,
"
normal
"
,
-
1
);
this
.
playDragonBoneAnimation
(
this
.
catAni
,
"
normal
"
,
-
1
);
});
});
this
.
isCanTap
=
false
;
// this.view.resultPaint.active=true;
// this.view.resultPaint.active=true;
// this.view.paint.active=false;
// this.view.paint.active=false;
...
...
assets/Coloring/script/Game/MenuModel.ts
View file @
39292dd9
...
@@ -14,7 +14,8 @@ export default class MenuModel extends Model{
...
@@ -14,7 +14,8 @@ export default class MenuModel extends Model{
await
new
Promise
<
void
>
(
resolve
=>
{
await
new
Promise
<
void
>
(
resolve
=>
{
getData
((
data
)
=>
{
getData
((
data
)
=>
{
resolve
();
resolve
();
cc
.
log
(
'
get data:
'
+
data
);
// cc.log('get data:' + data);
cc
.
log
(
data
);
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
))
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
))
})
})
...
...
bin/buildCocos.js
View file @
39292dd9
...
@@ -56,6 +56,9 @@ let creatorBasePath = 'C:\\CocosDashboard_1.0.6\\resources\\.editors\\Creator\\2
...
@@ -56,6 +56,9 @@ let creatorBasePath = 'C:\\CocosDashboard_1.0.6\\resources\\.editors\\Creator\\2
if
(
process
.
platform
!==
'
win32
'
)
{
if
(
process
.
platform
!==
'
win32
'
)
{
creatorBasePath
=
"
/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator
"
;
creatorBasePath
=
"
/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator
"
;
}
}
else
{
creatorBasePath
=
"
C:
\\
Tools
\\
CocosDashboard_1.0.20
\\
resources
\\
.editors
\\
Creator
\\
2.4.5
\\
CocosCreator.exe
"
;
}
const
buildCocos
=
function
(
args
)
{
const
buildCocos
=
function
(
args
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
buffer
=
spawn
(
const
buffer
=
spawn
(
...
...
package-lock.json
View file @
39292dd9
This diff is collapsed.
Click to expand it.
yarn.lock
View file @
39292dd9
This diff is collapsed.
Click to expand it.
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