1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-07-21 16:23:34 +02:00
SpaceCadetPinball/SpaceCadetPinball/TTextBox.h
Muzychenko Andrey 34a1e32843 Added in-game credits from Full Tilt.
This was kind-of requested a long time ago.
2023-03-17 16:38:08 +03:00

39 lines
788 B
C++

#pragma once
#include "score.h"
#include "TPinballComponent.h"
#include "TTextBoxMessage.h"
class TTextBox :
public TPinballComponent
{
public:
int OffsetX;
int OffsetY;
int Width;
int Height;
int Timer;
gdrv_bitmap8* BgBmp;
score_msg_font_type* Font;
TTextBoxMessage* CurrentMessage;
TTextBoxMessage* PreviousMessage;
TTextBox(TPinballTable* table, int groupIndex);
~TTextBox() override;
int Message(MessageCode code, float value) override;
void Clear(bool lowPriorityOnly = false);
void Display(const char* text, float time, bool lowPriority = false);
void DrawImGui();
private:
struct LayoutResult
{
char *Start, *End;
int Width;
};
static void TimerExpired(int timerId, void* caller);
void Draw();
LayoutResult LayoutTextLine(char* textStart) const;
};