main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | import RenderedMapShape from "./RenderedMapShape.js";
|
---|
2 |
|
---|
3 | export default class RenderedRoom 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: 'white',
|
---|
11 | stroke: 'black',
|
---|
12 | strokeWidth: 1,
|
---|
13 | draggable: false,
|
---|
14 | rotation: attrs.rotation,
|
---|
15 | cornerRadius:3,
|
---|
16 | zIndex: 0
|
---|
17 | });
|
---|
18 |
|
---|
19 | this.info.name = attrs.obj_name;
|
---|
20 | this.info.description = attrs.description;
|
---|
21 |
|
---|
22 | this.textOffsetX = -50
|
---|
23 |
|
---|
24 |
|
---|
25 | this.on("mouseenter",() => {
|
---|
26 | console.log("HOVER ROOM IN", this.x());
|
---|
27 | console.log(this.info.name,"NAME");
|
---|
28 | this.opacity(0.7);
|
---|
29 | this.fill("pink");
|
---|
30 | })
|
---|
31 | this.on("mouseleave", () => {
|
---|
32 | console.log("HOVER ROOM OUT");
|
---|
33 | this.opacity(1);
|
---|
34 | this.fill("white");
|
---|
35 | })
|
---|
36 |
|
---|
37 | this.initText()
|
---|
38 | }
|
---|
39 |
|
---|
40 |
|
---|
41 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.