Render the object, called automatically by plugin once each frame
()
| 892 | |
| 893 | /** Render the object, called automatically by plugin once each frame */ |
| 894 | render() |
| 895 | { |
| 896 | // call the custom render callback |
| 897 | this.onRender(); |
| 898 | |
| 899 | if (!this.size.x || !this.size.y) return; |
| 900 | |
| 901 | const isNavigationObject = this.isNavigationObject(); |
| 902 | const lineColor = isNavigationObject ? this.color : |
| 903 | this.interactive && this.isActiveObject() && !this.disabled ? |
| 904 | this.color : this.lineColor; |
| 905 | const color = isNavigationObject ? this.hoverColor : |
| 906 | this.disabled ? this.disabledColor : |
| 907 | this.interactive ? |
| 908 | this.isActiveObject() ? this.activeColor || this.hoverColor : |
| 909 | this.isHoverObject() ? this.hoverColor : |
| 910 | this.color : this.color; |
| 911 | const lineWidth = this.lineWidth * (isNavigationObject ? 1.5 : 1); |
| 912 | |
| 913 | uiSystem.drawRect(this.pos, this.size, color, lineWidth, lineColor, this.cornerRadius, this.gradientColor, this.shadowColor, this.shadowBlur, this.shadowOffset); |
| 914 | } |
| 915 | |
| 916 | /** Get the size for text with overrides and scale |
| 917 | * @return {Vector2} */ |
nothing calls this directly
no test coverage detected