source: imaps-frontend/src/scripts/rendered_shapes/RenderedStairs.js

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 
1import RenderedMapShape from "../base/RenderedMapShape.js";
2import Stairs from "../shapes/Stairs.js";
3import {_registerNode} from "konva/lib/Global";
4import Konva from "konva";
5export 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
42RenderedStairs.prototype.className = "RenderedStairs";
43_registerNode(RenderedStairs);
Note: See TracBrowser for help on using the repository browser.