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
|
Rev | Line | |
---|
[d565449] | 1 | import Konva from "konva";
|
---|
[0c6b92a] | 2 | import MapShape from "../base/MapShape.js";
|
---|
[d565449] | 3 | import { _registerNode } from 'konva/lib/Global';
|
---|
| 4 | export default class Wall extends MapShape {
|
---|
[0c6b92a] | 5 | constructor(attrs){
|
---|
| 6 | if(!attrs.fromLoad){
|
---|
| 7 | attrs.height *= 8;
|
---|
| 8 | }
|
---|
| 9 |
|
---|
| 10 |
|
---|
[d565449] | 11 | super(
|
---|
| 12 | {
|
---|
[0c6b92a] | 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",
|
---|
[d565449] | 18 | stroke: "grey",
|
---|
| 19 | strokeWidth: 1,
|
---|
| 20 | name: "mapObj",
|
---|
[0c6b92a] | 21 | draggable: true,
|
---|
| 22 | rotation: attrs.rotation,
|
---|
[d565449] | 23 | zIndex: 0,
|
---|
| 24 | },
|
---|
[0c6b92a] | 25 | attrs.layer,
|
---|
| 26 | attrs.blockSize,
|
---|
| 27 | attrs.snap,
|
---|
[d565449] | 28 | );
|
---|
| 29 | this.type = "Wall";
|
---|
[0c6b92a] | 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)
|
---|
[d565449] | 40 | }
|
---|
[0c6b92a] | 41 | }
|
---|
[d565449] | 42 |
|
---|
| 43 | Wall.prototype.className = 'Wall'
|
---|
| 44 | _registerNode(Wall); |
---|
Note:
See
TracBrowser
for help on using the repository browser.