@flashist/fconsole 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/console/Config.d.ts +118 -0
- package/console/Config.js +109 -0
- package/console/Config.js.map +1 -0
- package/console/FC.d.ts +29 -0
- package/console/FC.js +136 -0
- package/console/FC.js.map +1 -0
- package/console/tools/GlobalVarTools.d.ts +4 -0
- package/console/tools/GlobalVarTools.js +19 -0
- package/console/tools/GlobalVarTools.js.map +1 -0
- package/console/view/BaseConsoleButton.d.ts +19 -0
- package/console/view/BaseConsoleButton.js +85 -0
- package/console/view/BaseConsoleButton.js.map +1 -0
- package/console/view/BaseConsoleView.d.ts +41 -0
- package/console/view/BaseConsoleView.js +195 -0
- package/console/view/BaseConsoleView.js.map +1 -0
- package/console/view/ConsoleContentContainer.d.ts +8 -0
- package/console/view/ConsoleContentContainer.js +30 -0
- package/console/view/ConsoleContentContainer.js.map +1 -0
- package/console/view/ConsoleView.d.ts +9 -0
- package/console/view/ConsoleView.js +46 -0
- package/console/view/ConsoleView.js.map +1 -0
- package/console/view/capture/CaptureKeyButton.d.ts +16 -0
- package/console/view/capture/CaptureKeyButton.js +102 -0
- package/console/view/capture/CaptureKeyButton.js.map +1 -0
- package/console/view/capture/CaptureKeyButtonEvent.d.ts +3 -0
- package/console/view/capture/CaptureKeyButtonEvent.js +8 -0
- package/console/view/capture/CaptureKeyButtonEvent.js.map +1 -0
- package/console/view/displaylist/DisplayListItemView.d.ts +17 -0
- package/console/view/displaylist/DisplayListItemView.js +92 -0
- package/console/view/displaylist/DisplayListItemView.js.map +1 -0
- package/console/view/displaylist/DisplayListView.d.ts +56 -0
- package/console/view/displaylist/DisplayListView.js +555 -0
- package/console/view/displaylist/DisplayListView.js.map +1 -0
- package/console/view/fps/FpsMeterView.d.ts +13 -0
- package/console/view/fps/FpsMeterView.js +86 -0
- package/console/view/fps/FpsMeterView.js.map +1 -0
- package/console/view/pause/PauseKeyButton.d.ts +20 -0
- package/console/view/pause/PauseKeyButton.js +132 -0
- package/console/view/pause/PauseKeyButton.js.map +1 -0
- package/console/view/tooltip/ConsoleTooltip.d.ts +11 -0
- package/console/view/tooltip/ConsoleTooltip.js +82 -0
- package/console/view/tooltip/ConsoleTooltip.js.map +1 -0
- package/index.d.ts +15 -0
- package/index.js +16 -0
- package/index.js.map +1 -0
- package/package.json +50 -0
- package/tooltip/BaseTooltip.d.ts +9 -0
- package/tooltip/BaseTooltip.js +34 -0
- package/tooltip/BaseTooltip.js.map +1 -0
- package/tooltip/ITooltipData.d.ts +4 -0
- package/tooltip/ITooltipData.js +2 -0
- package/tooltip/ITooltipData.js.map +1 -0
- package/tooltip/TooltipManager.d.ts +37 -0
- package/tooltip/TooltipManager.js +135 -0
- package/tooltip/TooltipManager.js.map +1 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { StringTools } from "@flashist/fcore";
|
|
17
|
+
import { FContainer, FLabel, Graphics } from "@flashist/flibs";
|
|
18
|
+
import { FC } from "../../FC";
|
|
19
|
+
var FpsMeterView = /** @class */ (function (_super) {
|
|
20
|
+
__extends(FpsMeterView, _super);
|
|
21
|
+
function FpsMeterView() {
|
|
22
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
+
_this.prevTime = 0;
|
|
24
|
+
_this.time = 0;
|
|
25
|
+
_this.stepFps = 0;
|
|
26
|
+
//
|
|
27
|
+
_this.fpsValues = [];
|
|
28
|
+
_this.cumulativeFpsValue = 0;
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
FpsMeterView.prototype.construction = function () {
|
|
32
|
+
var args = [];
|
|
33
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
34
|
+
args[_i] = arguments[_i];
|
|
35
|
+
}
|
|
36
|
+
_super.prototype.construction.call(this, args);
|
|
37
|
+
this.border = new Graphics();
|
|
38
|
+
this.addChild(this.border);
|
|
39
|
+
//
|
|
40
|
+
this.border.beginFill(0x000000, 0);
|
|
41
|
+
// this.border.lineStyle(1, FC.config.fpsSettings.borderColor);
|
|
42
|
+
this.border.drawRect(0, 0, FC.config.fpsSettings.borderWidth, FC.config.fpsSettings.borderHeight);
|
|
43
|
+
this.field = new FLabel({
|
|
44
|
+
autosize: true,
|
|
45
|
+
color: FC.config.fpsSettings.labelColor,
|
|
46
|
+
size: FC.config.fpsSettings.labelSize
|
|
47
|
+
});
|
|
48
|
+
this.addChild(this.field);
|
|
49
|
+
this.field.text = StringTools.substituteList(FC.config.localization.fpsText, "00");
|
|
50
|
+
//
|
|
51
|
+
this.field.x = FC.config.fpsSettings.fieldToBorderPadding;
|
|
52
|
+
this.field.y = FC.config.fpsSettings.fieldToBorderPadding;
|
|
53
|
+
this.field.width = this.border.width - FC.config.fpsSettings.fieldToBorderPadding * 2;
|
|
54
|
+
this.field.height = this.border.height - FC.config.fpsSettings.fieldToBorderPadding * 2;
|
|
55
|
+
};
|
|
56
|
+
FpsMeterView.prototype.onAddedToStage = function () {
|
|
57
|
+
_super.prototype.onAddedToStage.call(this);
|
|
58
|
+
this.checkFps();
|
|
59
|
+
};
|
|
60
|
+
FpsMeterView.prototype.checkFps = function () {
|
|
61
|
+
var _this = this;
|
|
62
|
+
if (!this.stage) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.time = Date.now();
|
|
66
|
+
var delta = this.time - this.prevTime;
|
|
67
|
+
this.stepFps = Math.floor(1000 / delta);
|
|
68
|
+
if (this.fpsValues.length >= FC.config.fpsSettings.cumulativeFpsCount) {
|
|
69
|
+
var lastFps = this.fpsValues.shift();
|
|
70
|
+
this.cumulativeFpsValue -= lastFps;
|
|
71
|
+
}
|
|
72
|
+
this.fpsValues.push(this.stepFps);
|
|
73
|
+
this.cumulativeFpsValue += this.stepFps;
|
|
74
|
+
if (!this.cumulativeFpsValue || this.cumulativeFpsValue < 0) {
|
|
75
|
+
this.cumulativeFpsValue = 0;
|
|
76
|
+
}
|
|
77
|
+
this.field.text = StringTools.substituteList(FC.config.localization.fpsText, Math.floor(this.cumulativeFpsValue / this.fpsValues.length));
|
|
78
|
+
this.prevTime = this.time;
|
|
79
|
+
requestAnimationFrame(function () {
|
|
80
|
+
_this.checkFps();
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
return FpsMeterView;
|
|
84
|
+
}(FContainer));
|
|
85
|
+
export { FpsMeterView };
|
|
86
|
+
//# sourceMappingURL=FpsMeterView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FpsMeterView.js","sourceRoot":"","sources":["../../../../src/console/view/fps/FpsMeterView.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAC,EAAE,EAAC,MAAM,UAAU,CAAC;AAE5B;IAAkC,gCAAU;IAA5C;QAAA,qEA+EC;QA1Ea,cAAQ,GAAW,CAAC,CAAC;QACrB,UAAI,GAAW,CAAC,CAAC;QACjB,aAAO,GAAW,CAAC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CACxC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,EAC9B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAC9D,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAE1B,qBAAqB,CACjB;YACI,KAAI,CAAC,QAAQ,EAAE,CAAA;QACnB,CAAC,CACJ,CAAC;IACN,CAAC;IACL,mBAAC;AAAD,CAAC,AA/ED,CAAkC,UAAU,GA+E3C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseConsoleButton } from "../BaseConsoleButton";
|
|
2
|
+
import { InputManagerEventData } from "@flashist/flibs";
|
|
3
|
+
export declare class PauseKeyButton extends BaseConsoleButton {
|
|
4
|
+
private _pauseKeyCode;
|
|
5
|
+
pauseKey: string;
|
|
6
|
+
private _isClicked;
|
|
7
|
+
private _isActivated;
|
|
8
|
+
protected addListeners(): void;
|
|
9
|
+
protected onTick(): void;
|
|
10
|
+
protected onClick(): void;
|
|
11
|
+
protected onKeyUp(data: InputManagerEventData): void;
|
|
12
|
+
protected commitData(): void;
|
|
13
|
+
protected arrange(): void;
|
|
14
|
+
get isClicked(): boolean;
|
|
15
|
+
set isClicked(value: boolean);
|
|
16
|
+
get pauseKeyCode(): string;
|
|
17
|
+
set pauseKeyCode(value: string);
|
|
18
|
+
get isActivated(): boolean;
|
|
19
|
+
set isActivated(value: boolean);
|
|
20
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { BaseConsoleButton } from "../BaseConsoleButton";
|
|
17
|
+
import { FApp, InputManager, InputManagerEvent } from "@flashist/flibs";
|
|
18
|
+
import { StringTools } from "@flashist/fcore";
|
|
19
|
+
import { FC } from "../../FC";
|
|
20
|
+
var PauseKeyButton = /** @class */ (function (_super) {
|
|
21
|
+
__extends(PauseKeyButton, _super);
|
|
22
|
+
function PauseKeyButton() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
PauseKeyButton.prototype.addListeners = function () {
|
|
26
|
+
_super.prototype.addListeners.call(this);
|
|
27
|
+
this.eventListenerHelper.addEventListener(InputManager.instance, InputManagerEvent.KEY_UP, this.onKeyUp);
|
|
28
|
+
FApp.instance.ticker.add(this.onTick, this);
|
|
29
|
+
};
|
|
30
|
+
PauseKeyButton.prototype.onTick = function () {
|
|
31
|
+
if (!this.isClicked) {
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
PauseKeyButton.prototype.onClick = function () {
|
|
35
|
+
_super.prototype.onClick.call(this);
|
|
36
|
+
this.isClicked = !this.isClicked;
|
|
37
|
+
if (this.isClicked) {
|
|
38
|
+
this.pauseKeyCode = null;
|
|
39
|
+
this.isActivated = false;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
PauseKeyButton.prototype.onKeyUp = function (data) {
|
|
43
|
+
if (this.view.worldVisible) {
|
|
44
|
+
if (this.isClicked) {
|
|
45
|
+
this.isClicked = false;
|
|
46
|
+
this.pauseKey = data.nativeKeyboardEvent.key;
|
|
47
|
+
this.pauseKeyCode = data.nativeKeyboardEvent.code;
|
|
48
|
+
this.commitData();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
if (this.pauseKeyCode) {
|
|
52
|
+
if (this.pauseKeyCode === data.nativeKeyboardEvent.code) {
|
|
53
|
+
this.isActivated = !this.isActivated;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
PauseKeyButton.prototype.commitData = function () {
|
|
60
|
+
_super.prototype.commitData.call(this);
|
|
61
|
+
if (this.isClicked) {
|
|
62
|
+
this.text = FC.config.localization.pauseUpdateKeyBtnPressedLabel;
|
|
63
|
+
}
|
|
64
|
+
else if (this.pauseKeyCode) {
|
|
65
|
+
if (this.isActivated) {
|
|
66
|
+
this.text = StringTools.substitute(FC.config.localization.pauseUpdateKeyBtnNormalLabel, {
|
|
67
|
+
key: this.pauseKey,
|
|
68
|
+
status: FC.config.localization.onStatus
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.text = StringTools.substitute(FC.config.localization.pauseUpdateKeyBtnNormalLabel, {
|
|
73
|
+
key: this.pauseKey,
|
|
74
|
+
status: FC.config.localization.offStatus
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.text = StringTools.substitute(FC.config.localization.pauseUpdateKeyBtnNormalLabel, {
|
|
80
|
+
key: FC.config.localization.pauseUpdateKeyBtnNoKeyHelpText
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
PauseKeyButton.prototype.arrange = function () {
|
|
85
|
+
_super.prototype.arrange.call(this);
|
|
86
|
+
};
|
|
87
|
+
Object.defineProperty(PauseKeyButton.prototype, "isClicked", {
|
|
88
|
+
get: function () {
|
|
89
|
+
return this._isClicked;
|
|
90
|
+
},
|
|
91
|
+
set: function (value) {
|
|
92
|
+
if (value == this.isClicked) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this._isClicked = value;
|
|
96
|
+
this.commitData();
|
|
97
|
+
},
|
|
98
|
+
enumerable: false,
|
|
99
|
+
configurable: true
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(PauseKeyButton.prototype, "pauseKeyCode", {
|
|
102
|
+
get: function () {
|
|
103
|
+
return this._pauseKeyCode;
|
|
104
|
+
},
|
|
105
|
+
set: function (value) {
|
|
106
|
+
if (value === this._pauseKeyCode) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this._pauseKeyCode = value;
|
|
110
|
+
this.commitData();
|
|
111
|
+
},
|
|
112
|
+
enumerable: false,
|
|
113
|
+
configurable: true
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(PauseKeyButton.prototype, "isActivated", {
|
|
116
|
+
get: function () {
|
|
117
|
+
return this._isActivated;
|
|
118
|
+
},
|
|
119
|
+
set: function (value) {
|
|
120
|
+
if (value === this.isActivated) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this._isActivated = value;
|
|
124
|
+
this.commitData();
|
|
125
|
+
},
|
|
126
|
+
enumerable: false,
|
|
127
|
+
configurable: true
|
|
128
|
+
});
|
|
129
|
+
return PauseKeyButton;
|
|
130
|
+
}(BaseConsoleButton));
|
|
131
|
+
export { PauseKeyButton };
|
|
132
|
+
//# sourceMappingURL=PauseKeyButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PauseKeyButton.js","sourceRoot":"","sources":["../../../../src/console/view/pause/PauseKeyButton.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAC,IAAI,EAAE,YAAY,EAAE,iBAAiB,EAAwB,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAC,EAAE,EAA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AE,CAAC;QACtB,CAAC;;;OAVA;IAYD,sBAAW,wCAAY;aAAvB;YACI,OAAO,IAAI,CAAC,aAAa,CAAC;QAC9B,CAAC;aACD,UAAwB,KAAa;YACjC,IAAI,KAAK,KAAK,IAAI,CAAC,aAAa,EAAE;gBAC9B,OAAO;aACV;YAED,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;YAE3B,IAAI,CAAC,UAAU,EAAE,CAAC;QACtB,CAAC;;;OATA;IAWD,sBAAI,uCAAW;aAAf;YACI,OAAO,IAAI,CAAC,YAAY,CAAC;QAC7B,CAAC;aACD,UAAgB,KAAc;YAC1B,IAAI,KAAK,KAAK,IAAI,CAAC,WAAW,EAAE;gBAC5B,OAAO;aACV;YAED,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAE1B,IAAI,CAAC,UAAU,EAAE,CAAC;QACtB,CAAC;;;OATA;IAUL,qBAAC;AAAD,CAAC,AAxID,CAAoC,iBAAiB,GAwIpD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseTooltip } from "../../../tooltip/BaseTooltip";
|
|
2
|
+
export declare class ConsoleTooltip extends BaseTooltip {
|
|
3
|
+
private contentCont;
|
|
4
|
+
private titleLabel;
|
|
5
|
+
private textLabel;
|
|
6
|
+
private bg;
|
|
7
|
+
constructor();
|
|
8
|
+
protected construction(): void;
|
|
9
|
+
protected commitData(): void;
|
|
10
|
+
protected arrange(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { Graphics, FLabel, Align, FContainer } from "@flashist/flibs";
|
|
17
|
+
import { BaseTooltip } from "../../../tooltip/BaseTooltip";
|
|
18
|
+
import { FC } from "../../FC";
|
|
19
|
+
var ConsoleTooltip = /** @class */ (function (_super) {
|
|
20
|
+
__extends(ConsoleTooltip, _super);
|
|
21
|
+
function ConsoleTooltip() {
|
|
22
|
+
return _super.call(this) || this;
|
|
23
|
+
}
|
|
24
|
+
ConsoleTooltip.prototype.construction = function () {
|
|
25
|
+
_super.prototype.construction.call(this);
|
|
26
|
+
this.bg = new Graphics();
|
|
27
|
+
this.view.addChild(this.bg);
|
|
28
|
+
this.contentCont = new FContainer();
|
|
29
|
+
this.view.addChild(this.contentCont);
|
|
30
|
+
this.titleLabel = new FLabel({
|
|
31
|
+
autosize: true,
|
|
32
|
+
color: FC.config.tooltipSettings.titleLabelColor,
|
|
33
|
+
size: FC.config.tooltipSettings.titleLabelSize,
|
|
34
|
+
align: Align.CENTER
|
|
35
|
+
});
|
|
36
|
+
this.contentCont.addChild(this.titleLabel);
|
|
37
|
+
this.textLabel = new FLabel({
|
|
38
|
+
autosize: true,
|
|
39
|
+
color: FC.config.tooltipSettings.textLabelColor,
|
|
40
|
+
size: FC.config.tooltipSettings.textLabelSize,
|
|
41
|
+
align: Align.CENTER
|
|
42
|
+
});
|
|
43
|
+
this.contentCont.addChild(this.textLabel);
|
|
44
|
+
};
|
|
45
|
+
ConsoleTooltip.prototype.commitData = function () {
|
|
46
|
+
_super.prototype.commitData.call(this);
|
|
47
|
+
if (!this.tooltipData) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.titleLabel.text = this.tooltipData.title;
|
|
51
|
+
this.textLabel.text = this.tooltipData.text;
|
|
52
|
+
if (this.tooltipData.text) {
|
|
53
|
+
this.textLabel.visible = true;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this.textLabel.visible = false;
|
|
57
|
+
}
|
|
58
|
+
this.arrange();
|
|
59
|
+
};
|
|
60
|
+
ConsoleTooltip.prototype.arrange = function () {
|
|
61
|
+
_super.prototype.arrange.call(this);
|
|
62
|
+
if (this.textLabel.visible) {
|
|
63
|
+
var labelMaxWidth = Math.max(this.titleLabel.width, this.textLabel.width);
|
|
64
|
+
this.titleLabel.x = ((labelMaxWidth - this.titleLabel.width) >> 1);
|
|
65
|
+
this.textLabel.x = ((labelMaxWidth - this.textLabel.width) >> 1);
|
|
66
|
+
this.textLabel.y = this.titleLabel.y + this.titleLabel.height;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.titleLabel.x = 0;
|
|
70
|
+
}
|
|
71
|
+
this.bg.clear();
|
|
72
|
+
this.bg.beginFill(FC.config.tooltipSettings.bgColor, FC.config.tooltipSettings.bgAlpha);
|
|
73
|
+
this.bg.lineStyle(FC.config.tooltipSettings.borderWidth, FC.config.tooltipSettings.borderColor, FC.config.tooltipSettings.borderAlpha);
|
|
74
|
+
this.bg.drawRect(0, 0, this.contentCont.width + FC.config.tooltipSettings.bgToContentShift.x, this.contentCont.height + FC.config.tooltipSettings.bgToContentShift.y);
|
|
75
|
+
this.bg.endFill();
|
|
76
|
+
this.contentCont.x = this.bg.x + ((this.bg.width - this.contentCont.width) >> 1);
|
|
77
|
+
this.contentCont.y = this.bg.y + ((this.bg.height - this.contentCont.height) >> 1);
|
|
78
|
+
};
|
|
79
|
+
return ConsoleTooltip;
|
|
80
|
+
}(BaseTooltip));
|
|
81
|
+
export { ConsoleTooltip };
|
|
82
|
+
//# sourceMappingURL=ConsoleTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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console/view/BaseConsoleButton';
|
|
4
|
+
export * from './console/view/BaseConsoleView';
|
|
5
|
+
export * from './console/view/capture/CaptureKeyButton';
|
|
6
|
+
export * from './console/view/capture/CaptureKeyButtonEvent';
|
|
7
|
+
export * from './console/view/pause/PauseKeyButton';
|
|
8
|
+
export * from './console/view/ConsoleView';
|
|
9
|
+
export * from './console/view/displaylist/DisplayListView';
|
|
10
|
+
export * from './console/view/displaylist/DisplayListItemView';
|
|
11
|
+
export * from './console/view/fps/FpsMeterView';
|
|
12
|
+
export * from './console/view/tooltip/ConsoleTooltip';
|
|
13
|
+
export * from './tooltip/BaseTooltip';
|
|
14
|
+
export * from './tooltip/ITooltipData';
|
|
15
|
+
export * from './tooltip/TooltipManager';
|
package/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './console/Config';
|
|
2
|
+
export * from './console/FC';
|
|
3
|
+
export * from './console/view/BaseConsoleButton';
|
|
4
|
+
export * from './console/view/BaseConsoleView';
|
|
5
|
+
export * from './console/view/capture/CaptureKeyButton';
|
|
6
|
+
export * from './console/view/capture/CaptureKeyButtonEvent';
|
|
7
|
+
export * from './console/view/pause/PauseKeyButton';
|
|
8
|
+
export * from './console/view/ConsoleView';
|
|
9
|
+
export * from './console/view/displaylist/DisplayListView';
|
|
10
|
+
export * from './console/view/displaylist/DisplayListItemView';
|
|
11
|
+
export * from './console/view/fps/FpsMeterView';
|
|
12
|
+
export * from './console/view/tooltip/ConsoleTooltip';
|
|
13
|
+
export * from './tooltip/BaseTooltip';
|
|
14
|
+
export * from './tooltip/ITooltipData';
|
|
15
|
+
export * from './tooltip/TooltipManager';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,kCAAkC,CAAA;AAChD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,yCAAyC,CAAA;AACvD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,qCAAqC,CAAA;AACnD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4CAA4C,CAAA;AAC1D,cAAc,gDAAgD,CAAA;AAC9D,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uCAAuC,CAAA;AACrD,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flashist/fconsole",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"private": false,
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/flashist/fconsole.git"
|
|
9
|
+
},
|
|
10
|
+
"description": "Bunch* of useful debug tools for speeding up development process of Pixi.js based applications. Written in TypeScript. Inspired by Flash-Console.",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"pixi.js",
|
|
13
|
+
"pixijs",
|
|
14
|
+
"canvas",
|
|
15
|
+
"webgl",
|
|
16
|
+
"debugging",
|
|
17
|
+
"debug",
|
|
18
|
+
"devtools",
|
|
19
|
+
"dev tools",
|
|
20
|
+
"developer tools",
|
|
21
|
+
"display list",
|
|
22
|
+
"DisplayList",
|
|
23
|
+
"console",
|
|
24
|
+
"hierarchy"
|
|
25
|
+
],
|
|
26
|
+
"main": "index.js",
|
|
27
|
+
"typings": "index.d.ts",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "gulp",
|
|
30
|
+
"publish:patch": "npm version patch && npm run build && cd ./dist && npm publish",
|
|
31
|
+
"publish:minor": "npm version minor && npm run build && cd ./dist && npm publish",
|
|
32
|
+
"publish:major": "npm version major && npm run build && cd ./dist && npm publish"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@flashist/flibs": "0.x"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"gulp": "^4.0.2",
|
|
39
|
+
"gulp-shell": "^0.8.0",
|
|
40
|
+
"pixi.js": "^5.3.3",
|
|
41
|
+
"require-dir": "^1.2.0",
|
|
42
|
+
"rimraf": "^3.0.2",
|
|
43
|
+
"typescript": "^4.0.2"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/flashist/fconsole/issues"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/flashist/fconsole#readme",
|
|
49
|
+
"author": "Mark Dolbyrev"
|
|
50
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DisplayObjectContainer } from "@flashist/flibs";
|
|
2
|
+
import { BaseObject } from "@flashist/fcore";
|
|
3
|
+
import { ITooltipData } from "./ITooltipData";
|
|
4
|
+
export declare abstract class BaseTooltip extends BaseObject {
|
|
5
|
+
view: DisplayObjectContainer;
|
|
6
|
+
protected tooltipData: ITooltipData;
|
|
7
|
+
protected construction(): void;
|
|
8
|
+
protected commitData(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { FContainer } from "@flashist/flibs";
|
|
17
|
+
import { BaseObject } from "@flashist/fcore";
|
|
18
|
+
var BaseTooltip = /** @class */ (function (_super) {
|
|
19
|
+
__extends(BaseTooltip, _super);
|
|
20
|
+
function BaseTooltip() {
|
|
21
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
BaseTooltip.prototype.construction = function () {
|
|
24
|
+
_super.prototype.construction.call(this);
|
|
25
|
+
this.view = new FContainer();
|
|
26
|
+
};
|
|
27
|
+
BaseTooltip.prototype.commitData = function () {
|
|
28
|
+
_super.prototype.commitData.call(this);
|
|
29
|
+
this.tooltipData = this.data;
|
|
30
|
+
};
|
|
31
|
+
return BaseTooltip;
|
|
32
|
+
}(BaseObject));
|
|
33
|
+
export { BaseTooltip };
|
|
34
|
+
//# sourceMappingURL=BaseTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseTooltip.js","sourceRoot":"","sources":["../../src/tooltip/BaseTooltip.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAyB,UAAU,EAAC,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAI3C;IAA0C,+BAAU;IAApD;;IAmBA,CAAC;IAZa,kCAAY,GAAtB;QACI,iBAAM,YAAY,WAAE,CAAC;QAErB,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;IACjC,CAAC;IAGS,gCAAU,GAApB;QACI,iBAAM,UAAU,WAAE,CAAC;QAEnB,IAAI,CAAC,WAAW,GAAI,IAAI,CAAC,IAAqB,CAAC;IACnD,CAAC;IACL,kBAAC;AAAD,CAAC,AAnBD,CAA0C,UAAU,GAmBnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITooltipData.js","sourceRoot":"","sources":["../../src/tooltip/ITooltipData.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseObject } from "@flashist/fcore";
|
|
2
|
+
import { DisplayObjectContainer, Point } from "@flashist/flibs";
|
|
3
|
+
import { BaseTooltip } from "./BaseTooltip";
|
|
4
|
+
import { ITooltipData } from "./ITooltipData";
|
|
5
|
+
export declare class TooltipManager extends BaseObject {
|
|
6
|
+
private static SHOW_DELAY;
|
|
7
|
+
private _tooltipCont;
|
|
8
|
+
private tooltipInsideCont;
|
|
9
|
+
private tooltip;
|
|
10
|
+
private _mouseShift;
|
|
11
|
+
private _visible;
|
|
12
|
+
constructor(tooltip: BaseTooltip);
|
|
13
|
+
protected construction(tooltip: BaseTooltip): void;
|
|
14
|
+
protected addListeners(): void;
|
|
15
|
+
protected removeListeners(): void;
|
|
16
|
+
private onTick;
|
|
17
|
+
show(data: ITooltipData): void;
|
|
18
|
+
hide(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Обновление подсказки.
|
|
21
|
+
*/
|
|
22
|
+
update(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Move a tooltip to a new position.
|
|
25
|
+
* Might be overridden in subclasses to implement different behavior (e.g. tween movement).
|
|
26
|
+
*
|
|
27
|
+
* @param x
|
|
28
|
+
* @param y
|
|
29
|
+
*/
|
|
30
|
+
protected moveTooltipTo(x: number, y: number): void;
|
|
31
|
+
get tooltipCont(): DisplayObjectContainer;
|
|
32
|
+
set tooltipCont(value: DisplayObjectContainer);
|
|
33
|
+
get mouseShift(): Point;
|
|
34
|
+
set mouseShift(value: Point);
|
|
35
|
+
private get visible();
|
|
36
|
+
private set visible(value);
|
|
37
|
+
}
|