MCPcopy Create free account
hub / github.com/doldecomp/mkdd / drawSelf

Method drawSelf

libs/JSystem/J2DGraph/J2DTextBoxEx.cpp:101–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void J2DTextBoxEx::drawSelf(f32 x, f32 y, Mtx* mtx)
102{
103 Mtx newMtx;
104
105 JUTFont* font = nullptr;
106 if (mMaterial && mMaterial->getTevBlock()) {
107 font = mMaterial->getTevBlock()->getFont();
108 }
109
110 J2DPrint print(font, (int)mCharSpacing, (int)mLineSpacing, mCharColor, mGradientColor, mBlack, mWhite);
111 print.setFontSize((int)mFontSize.x, (int)mFontSize.y);
112
113 if (mMaterial) {
114 mMaterial->setGX();
115 PSMTXConcat(*mtx, mGlobalMtx, newMtx);
116
117 GXLoadPosMtxImm(newMtx, GX_PNMTX0);
118 GXClearVtxDesc();
119 GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
120 GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
121 GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
122
123 print.locate(x + mBounds.i.x, y + mBounds.i.y);
124
125 if (mMaterial->isVisible() && mStringPtr) {
126 u8 alpha = 255;
127
128 if (mMaterial->getColorBlock()->getColorChan(1)->getMatSrc() == 1) {
129 if (mMaterial->getMaterialAlphaCalc() == 1) {
130 alpha = mColorAlpha;
131 }
132 } else if (mIsInfluencedAlpha) {
133 GXSetChanMatColor(GX_ALPHA0, JUTColor(mColorAlpha));
134 }
135
136 print.printReturn(mStringPtr, (int)(mBounds.getWidth() + 0.0001f), (int)mBounds.getHeight(), getHBinding(), getVBinding(),
137 mOffsetX, mOffsetY, alpha);
138 }
139 }
140}
141
142void J2DTextBoxEx::draw(f32 x, f32 y)
143{

Callers

nothing calls this directly

Calls 13

locateMethod · 0.80
getColorChanMethod · 0.80
printReturnMethod · 0.80
getTevBlockMethod · 0.45
getFontMethod · 0.45
setFontSizeMethod · 0.45
setGXMethod · 0.45
isVisibleMethod · 0.45
getMatSrcMethod · 0.45
getColorBlockMethod · 0.45
getMaterialAlphaCalcMethod · 0.45
getWidthMethod · 0.45

Tested by

no test coverage detected