Files
tww/include/JSystem/J2DGraph/J2DTextBox.h
T
Teddy Heidmann f288e35ac5 d_menu_fmap2 (#1237)
* regswaps

* clearer variables

* enum for maptype

* clearer reg names

* capitalize hex

* cCursorAnime()

* _delete, fCursorInit

* _open, _draw

* _close, changeZoomCmap

* gsMoonAnime, gsShipAnime

* trTrifAnime

* changeSelCmap2

* cmapAlphaSet

* fCursorAnime

* ChangeProcMode

* fCursorMove

* cSelCursorAnime

* playerPointGridAnime

* changeIslandName, fmapPlayerPosDisp

* fmapPlayerPosDispCheck

* changeCmapName

* cmapPlayerPosDisp

* paneAlpha fns

* pane renames

* cmapSalvagePosDisp

* cmapPlayerPosDispCheck

* paneTranceMessage

* field renames

* added enums

* HIO colors and renames

* GZLE01

* GZLJ01

* GZLP01

* D44J01 progress

* fix setBlackWhite return

* remove import

* demo update
2026-10-12 12:47:28 -04:00

104 lines
3.1 KiB
C++

#ifndef J2DTEXTBOX_H
#define J2DTEXTBOX_H
#include "JSystem/J2DGraph/J2DPane.h"
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JUtility/JUTFont.h"
#include "JSystem/JUtility/JUTResFont.h"
enum J2DTextBoxHBinding {
/* 0x0 */ HBIND_CENTER,
/* 0x1 */ HBIND_RIGHT,
/* 0x2 */ HBIND_LEFT
};
enum J2DTextBoxVBinding {
/* 0x0 */ VBIND_CENTER,
/* 0x1 */ VBIND_BOTTOM,
/* 0x2 */ VBIND_TOP
};
struct J2DTbxBlockHeader {
/* 0x00 */ u32 mMagic;
/* 0x04 */ s32 mSize;
};
class J2DTextBox : public J2DPane {
public:
struct TFontSize {
/* 0x0 */ f32 mSizeX;
/* 0x4 */ f32 mSizeY;
};
J2DTextBox(const char*, const char*);
J2DTextBox(J2DPane*, JSURandomInputStream*);
J2DTextBox(u32, const JGeometry::TBox2<f32>&, const ResFONT*, const char*, J2DTextBoxHBinding,
J2DTextBoxVBinding);
void initiate(const ResFONT*, const char*, J2DTextBoxHBinding, J2DTextBoxVBinding);
void setFont(JUTFont*);
JUTFont* getFont() const { return mpFont; }
void setFontSize(f32 sizeX, f32 sizeY) {
mFontSizeX = sizeX > 0.0f ? sizeX : 0.0f;
mFontSizeY = sizeY > 0.0f ? sizeY : 0.0f;
}
void setFontSize(TFontSize size) {
setFontSize(size.mSizeX, size.mSizeY);
}
void getFontSize(TFontSize& size) const {
size.mSizeX = mFontSizeX;
size.mSizeY = mFontSizeY;
}
void shiftSet(f32 x, f32 y) {
field_0xd8 = x;
field_0xdc = y;
}
void setCharColor(JUtility::TColor c) { mCharColor.set(c); }
void setGradColor(JUtility::TColor c) { mGradColor.set(c); }
void setBlack(JUtility::TColor c) { mBlack = c; }
void setWhite(JUtility::TColor c) { mWhite = c; }
void setBlackWhite(JUtility::TColor black, JUtility::TColor white) {
mBlack = black;
mWhite = white;
}
void setLineSpace(f32 x) { mLineSpace = x; }
f32 getLineSpace() const { return mLineSpace; }
f32 getCharSpace() const { return mCharSpace; }
void setCharSpace(f32 x) { mCharSpace = x; }
void draw(f32, f32, f32, J2DTextBoxHBinding);
char* getStringPtr() const;
s32 setString(const char*, ...);
void setFontColor(JUtility::TColor i_charColor, JUtility::TColor i_GradientColor) {
mCharColor = i_charColor;
mGradColor = i_GradientColor;
}
virtual ~J2DTextBox();
virtual bool setConnectParent(bool);
virtual void drawSelf(f32, f32);
virtual void drawSelf(f32, f32, Mtx*);
virtual void resize(f32, f32);
virtual u16 getTypeID() { return 19; };
public:
/* 0xCC */ JUTFont* mpFont;
/* 0xD0 */ JUtility::TColor mCharColor;
/* 0xD4 */ JUtility::TColor mGradColor;
/* 0xD8 */ f32 field_0xd8;
/* 0xDC */ f32 field_0xdc;
/* 0xE0 */ f32 mCharSpace;
/* 0xE4 */ f32 mLineSpace;
/* 0xE8 */ f32 mFontSizeX;
/* 0xEC */ f32 mFontSizeY;
/* 0xF0 */ char* mStringPtr;
/* 0xF4 */ JUtility::TColor mWhite;
/* 0xF8 */ JUtility::TColor mBlack;
/* 0xFC */ u8 mBindingH;
/* 0xFD */ u8 mBindingV;
/* 0xFE */ bool mTextFontOwned;
}; // Size: 0x100
#endif /* J2DTEXTBOX_H */