main
Last change
on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago |
Pred finalna verzija
|
-
Property mode
set to
100644
|
File size:
998 bytes
|
Line | |
---|
1 | import Konva from "konva";
|
---|
2 | import MapShape from "../base/MapShape.js";
|
---|
3 | import { _registerNode } from 'konva/lib/Global';
|
---|
4 | export default class Wall extends MapShape {
|
---|
5 | constructor(attrs){
|
---|
6 | if(!attrs.fromLoad){
|
---|
7 | attrs.height *= 8;
|
---|
8 | }
|
---|
9 |
|
---|
10 |
|
---|
11 | super(
|
---|
12 | {
|
---|
13 | x: attrs.position.x,
|
---|
14 | y: attrs.position.y,
|
---|
15 | width: attrs.width * attrs.scaleX,
|
---|
16 | height: attrs.height * attrs.scaleY,
|
---|
17 | fill: "#d3d3d3",
|
---|
18 | stroke: "grey",
|
---|
19 | strokeWidth: 1,
|
---|
20 | name: "mapObj",
|
---|
21 | draggable: true,
|
---|
22 | rotation: attrs.rotation,
|
---|
23 | zIndex: 0,
|
---|
24 | },
|
---|
25 | attrs.layer,
|
---|
26 | attrs.blockSize,
|
---|
27 | attrs.snap,
|
---|
28 | );
|
---|
29 | this.type = "Wall";
|
---|
30 |
|
---|
31 | this.floorNum = attrs.floorNum;
|
---|
32 | }
|
---|
33 |
|
---|
34 | loadInfo(attrs) {
|
---|
35 | this.floorNum = attrs.floor_num;
|
---|
36 | }
|
---|
37 |
|
---|
38 | saveShapeDetails() {
|
---|
39 | this.setAttr("floor_num",this.floorNum)
|
---|
40 | }
|
---|
41 | }
|
---|
42 |
|
---|
43 | Wall.prototype.className = 'Wall'
|
---|
44 | _registerNode(Wall); |
---|
Note:
See
TracBrowser
for help on using the repository browser.