Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/src/scripts/rendered_shapes/RenderedEntrance.js
rd565449 r0c6b92a 1 import RenderedMapShape from "./RenderedMapShape.js"; 1 import RenderedMapShape from "../base/RenderedMapShape.js"; 2 import {_registerNode} from "konva/lib/Global"; 3 import RenderedRoom from "./RenderedRoom.js"; 2 4 3 export default class RenderedEntrance extends RenderedMapShape {4 constructor(attrs,scaleX,scaleY){5 6 7 8 9 10 fill: '#1c3cff',11 stroke: 'black',12 13 14 15 cornerRadius:3,16 zIndex: 017 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 }); 18 20 19 this.info.name = attrs.obj_name; 20 this.info.description = attrs.description; 21 22 23 this.on("mouseenter",() => { 24 console.log("HOVER ROOM IN", this.x()); 25 console.log(this.info.name,"NAME"); 26 this.stroke('purple'); 27 }) 28 this.on("mouseleave", () => { 29 console.log("HOVER ROOM OUT"); 30 this.opacity(1); 31 this.stroke('black') 21 this.info.name = attrs.obj_name; 22 this.info.description = attrs.description; 23 this.info.isMainEntrance = attrs.is_main_entrance; 32 24 33 })25 this.floorNum = attrs.floor_num 34 26 35 this.initText() 36 } 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 } 37 41 } 42 43 RenderedEntrance.prototype.className = "RenderedEntrance"; 44 _registerNode(RenderedEntrance);
Note:
See TracChangeset
for help on using the changeset viewer.