drawThemeState¶
fun GuiGraphics.drawThemeState(
state: ThemeState,
x: Int,
y: Int,
width: Int,
height: Int
)
Draws a ThemeState to the screen - tinted by whatever RenderSystem.setShaderColor currently has active (net.kernelpanicsoft.archie.gui.composables.containers.Tinted is what sets it), automatically and for every caller: the plain, opaque-white default (no Tinted wrapper active anywhere above this call) draws exactly as this always has, and anything else routes through a genuinely different draw call, not just a different pose/uniform state applied on top of the usual one. Vanilla's own atlas-sprite blit path (GuiGraphics.blitSprite, used below for any atlas-sprite texture, node_frame included) draws through an immediate Tesselator call using a plain, colorless position_tex shader - confirmed directly against GuiGraphics's own decompiled source, not assumed - that never samples the ColorModulator uniform RenderSystem.setShaderColor sets at all, unlike ordinary text rendering (which goes through the normal batched RenderType pipeline and does sample it) - the reason a Tinted wrapper around, say, a net.kernelpanicsoft.archie.gui.composables.containers.NodeAnimation fade would otherwise visibly reach a node's own text but not its themed background. innerBlitTinted and friends below port vanilla's own private nine-slice/tile blitting (GuiGraphics.blitNineSlicedSprite/ blitTiledSprite, package-private and therefore unreachable from here) line-for-line, just threading an explicit tint through every one of their own leaf draw calls instead of the colorless one vanilla's own private innerBlit overload uses - a plain single-quad stretch would otherwise visibly distort anything nine-sliced (node_frame's own border art, say) for as long as it stays tinted, not just a passing frame or two. A raw (non-atlas) SimpleThemeState.texture has no TextureAtlasSprite/nine-slice metadata to port a tinted path against, but still reaches innerBlitTinted directly via blitTinted below - the same UV normalization ((uOffset + 0) / textureWidth, etc.) vanilla's own untinted blit(ResourceLocation, x,y,width,height, uOffset,vOffset,uWidth,vHeight, textureWidth,textureHeight) overload uses on its own way down to its own private innerBlit, confirmed directly against GuiGraphics's own decompiled source rather than assumed.