main
Last change
on this file was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago |
Pred finalna verzija
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | import RenderedMapShape from "../base/RenderedMapShape.js";
|
---|
2 | import Stairs from "../shapes/Stairs.js";
|
---|
3 | import {_registerNode} from "konva/lib/Global";
|
---|
4 | import Konva from "konva";
|
---|
5 | export default class RenderedStairs extends RenderedMapShape{
|
---|
6 | constructor(attrs,scaleX,scaleY) {
|
---|
7 | super({
|
---|
8 | x: attrs.x,
|
---|
9 | y: attrs.y,
|
---|
10 | width: attrs.width * scaleX,
|
---|
11 | height: attrs.height * scaleY,
|
---|
12 | fill: "rgb(199,190,133)",
|
---|
13 | stroke: "rgb(16,15,15)",
|
---|
14 | strokeWidth: 1,
|
---|
15 | name: "mapObj",
|
---|
16 | rotation: attrs.rotation,
|
---|
17 | });
|
---|
18 |
|
---|
19 |
|
---|
20 | this.floorNum = attrs.floor_num;
|
---|
21 | this.info.name = attrs.obj_name;
|
---|
22 | //this.initText()
|
---|
23 | }
|
---|
24 |
|
---|
25 |
|
---|
26 |
|
---|
27 |
|
---|
28 | _sceneFunc(context, shape) {
|
---|
29 | const { width, height} = this.attrs;
|
---|
30 |
|
---|
31 | let steps = 5;
|
---|
32 | let offset = 10;
|
---|
33 | context.beginPath()
|
---|
34 | for(let i = 0; i < steps; i++){
|
---|
35 | context.rect((-offset) * i,(offset * 0.6) * i,width * 0.86,height/2)
|
---|
36 | context.fillStrokeShape(shape);
|
---|
37 | }
|
---|
38 | context.closePath()
|
---|
39 | }
|
---|
40 | }
|
---|
41 |
|
---|
42 | RenderedStairs.prototype.className = "RenderedStairs";
|
---|
43 | _registerNode(RenderedStairs);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.