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:
1.1 KB
|
Rev | Line | |
---|
[0c6b92a] | 1 | import RenderedMapShape from "../base/RenderedMapShape.js";
|
---|
| 2 | import {_registerNode} from "konva/lib/Global";
|
---|
| 3 | import RenderedRoom from "./RenderedRoom.js";
|
---|
| 4 |
|
---|
| 5 | export default class RenderedEntrance 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: "#7fef83",
|
---|
| 13 | stroke: "black",
|
---|
| 14 | strokeWidth: 1,
|
---|
| 15 | draggable: false,
|
---|
| 16 | rotation: attrs.rotation,
|
---|
| 17 | cornerRadius: 3,
|
---|
| 18 | zIndex: 0,
|
---|
| 19 | });
|
---|
| 20 |
|
---|
| 21 | this.info.name = attrs.obj_name;
|
---|
| 22 | this.info.description = attrs.description;
|
---|
| 23 | this.info.isMainEntrance = attrs.is_main_entrance;
|
---|
| 24 |
|
---|
| 25 | this.floorNum = attrs.floor_num
|
---|
| 26 |
|
---|
| 27 | this.class = "Entrance";
|
---|
| 28 |
|
---|
| 29 | console.log("ATTRS VIEW: " + attrs)
|
---|
| 30 |
|
---|
| 31 | this.on("mouseenter", () => {
|
---|
| 32 | this.stroke("purple");
|
---|
| 33 | });
|
---|
| 34 | this.on("mouseleave", () => {
|
---|
| 35 | this.opacity(1);
|
---|
| 36 | this.stroke("black");
|
---|
| 37 | });
|
---|
| 38 |
|
---|
| 39 | //this.initText();
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | RenderedEntrance.prototype.className = "RenderedEntrance";
|
---|
| 44 | _registerNode(RenderedEntrance);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.