Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/src/scripts/rendered_shapes/RenderedEntrance.js

    rd565449 r0c6b92a  
    1 import RenderedMapShape from "./RenderedMapShape.js";
     1import RenderedMapShape from "../base/RenderedMapShape.js";
     2import {_registerNode} from "konva/lib/Global";
     3import RenderedRoom from "./RenderedRoom.js";
    24
    3 export default class RenderedEntrance extends RenderedMapShape{
    4     constructor(attrs,scaleX,scaleY){
    5         super({
    6             x: attrs.x,
    7             y: attrs.y,
    8             width: attrs.width * scaleX,
    9             height: attrs.height * scaleY,
    10             fill: '#1c3cff',
    11             stroke: 'black',
    12             strokeWidth: 1,
    13             draggable: false,
    14             rotation: attrs.rotation,
    15             cornerRadius:3,
    16             zIndex: 0
    17         });
     5export 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    });
    1820
    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;
    3224
    33         })
     25    this.floorNum = attrs.floor_num
    3426
    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  }
    3741}
     42
     43RenderedEntrance.prototype.className = "RenderedEntrance";
     44_registerNode(RenderedEntrance);
Note: See TracChangeset for help on using the changeset viewer.