Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU-17
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
PU-17
Commits
018ffe28
Commit
018ffe28
authored
Jun 28, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板完善
parent
830a2d28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
4 deletions
+37
-4
Palette2.ts
src/app/play/Palette2.ts
+5
-4
Unit.ts
src/app/play/Unit.ts
+32
-0
No files found.
src/app/play/Palette2.ts
View file @
018ffe28
import
{
Item
}
from
'
./Item
'
;
import
{
Item
}
from
'
./Item
'
;
import
{
ShapeRect
,
MySprite
,
ShapeCircle
}
from
'
./Unit
'
;
import
{
ShapeRect
,
MySprite
,
ShapeCircle
,
LineCircle
}
from
'
./Unit
'
;
export
class
Palette
extends
Item
{
export
class
Palette
extends
Item
{
...
@@ -116,11 +116,11 @@ export class ColorCard extends Item {
...
@@ -116,11 +116,11 @@ export class ColorCard extends Item {
this
.
lightPic
=
colorCardLight
;
this
.
lightPic
=
colorCardLight
;
bg
.
addChild
(
colorCardLight
);
bg
.
addChild
(
colorCardLight
);
const
colorCircle
=
new
ShapeCircle
();
const
colorCircle
=
new
LineCircle
();
colorCircle
.
fillColor
=
"
#ffffff
"
;
colorCircle
.
lineColor
=
color
;
colorCircle
.
lineWidth
=
2
*
this
.
scaleX
;
colorCircle
.
radius
=
29.5
*
this
.
scaleX
;
colorCircle
.
radius
=
29.5
*
this
.
scaleX
;
colorCircle
.
color
=
color
;
colorCircle
.
color
=
color
;
colorCircle
.
x
=
bg
.
width
/
2
;
colorCircle
.
x
=
bg
.
width
/
2
;
colorCircle
.
y
=
bg
.
height
/
2
;
colorCircle
.
y
=
bg
.
height
/
2
;
bg
.
addChild
(
colorCircle
);
bg
.
addChild
(
colorCircle
);
...
@@ -129,6 +129,7 @@ export class ColorCard extends Item {
...
@@ -129,6 +129,7 @@ export class ColorCard extends Item {
colorCardPic
.
fillColor
=
color
;
colorCardPic
.
fillColor
=
color
;
colorCardPic
.
radius
=
25.5
*
this
.
scaleX
;
colorCardPic
.
radius
=
25.5
*
this
.
scaleX
;
colorCardPic
.
color
=
color
;
colorCardPic
.
color
=
color
;
colorCardPic
.
x
=
bg
.
width
/
2
;
colorCardPic
.
x
=
bg
.
width
/
2
;
colorCardPic
.
y
=
bg
.
height
/
2
;
colorCardPic
.
y
=
bg
.
height
/
2
;
bg
.
addChild
(
colorCardPic
);
bg
.
addChild
(
colorCardPic
);
...
...
src/app/play/Unit.ts
View file @
018ffe28
...
@@ -974,6 +974,38 @@ export class ShapeCircle extends MySprite {
...
@@ -974,6 +974,38 @@ export class ShapeCircle extends MySprite {
}
}
}
}
export
class
LineCircle
extends
MySprite
{
lineColor
=
'
#ffffff
'
;
lineWidth
=
10
;
setRadius
(
r
)
{
this
.
anchorX
=
this
.
anchorY
=
0.5
;
this
.
radius
=
r
;
this
.
width
=
r
*
2
;
this
.
height
=
r
*
2
;
}
drawLine
()
{
this
.
ctx
.
beginPath
();
this
.
ctx
.
arc
(
0
,
0
,
this
.
radius
,
0
,
angleToRadian
(
360
));
this
.
ctx
.
lineWidth
=
this
.
lineWidth
;
this
.
ctx
.
strokeStyle
=
this
.
lineColor
;
// "#ffffff";
this
.
ctx
.
stroke
();
}
drawSelf
()
{
super
.
drawSelf
();
this
.
drawLine
();
}
}
export
class
ShapeRectNew
extends
MySprite
{
export
class
ShapeRectNew
extends
MySprite
{
...
...
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