Commit 018ffe28 authored by Chen Jiping's avatar Chen Jiping

模板完善

parent 830a2d28
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);
......
...@@ -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 {
......
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