| 99 | } |
| 100 | |
| 101 | void 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 | |
| 142 | void J2DTextBoxEx::draw(f32 x, f32 y) |
| 143 | { |
nothing calls this directly
no test coverage detected