MCPcopy
hub / github.com/KilledByAPixel/LittleJS / render

Method render

plugins/uiSystem.js:894–914  ·  view source on GitHub ↗

Render the object, called automatically by plugin once each frame

()

Source from the content-addressed store, hash-verified

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} */

Callers

nothing calls this directly

Calls 5

onRenderMethod · 0.95
isNavigationObjectMethod · 0.95
isActiveObjectMethod · 0.95
isHoverObjectMethod · 0.95
drawRectMethod · 0.45

Tested by

no test coverage detected