Scrolling/Scrollbar Fixes
Open Up UI7 API for Custom Objects outside of UI7
Add Text Shorter to R2
This commit is contained in:
2024-06-22 14:36:17 +02:00
parent d3a1dc40f5
commit f7e4d9848a
5 changed files with 128 additions and 101 deletions

View File

@ -85,6 +85,7 @@ class R2Base {
void Process();
R7Vec2 GetTextDimensions(const std::string& text);
std::string WrapText(const std ::string& in, int maxlen);
std::string ShortText(const std::string& in, int maxlen);
// Draw Functions
void AddRect(R7Vec2 pos, R7Vec2 size, RD7Color clr);
void AddRect(R7Vec2 pos, R7Vec2 size, unsigned int clr);

View File

@ -102,12 +102,20 @@ R7Vec2 GetCursorPos();
void SetCursorPos(R7Vec2 cp);
void RestoreCursor();
void SameLine();
float GetScrollingOffset();
// Internal API (For Creating Custom Objects)
bool InBox(R7Vec2 inpos, R7Vec2 boxpos, R7Vec2 boxsize);
void MoveCursor(R7Vec2 size);
bool HandleScrolling(R7Vec2 &pos, R7Vec2 size);
bool InMenu();
namespace Menu {
// All of them return the Main BG DrawList if Menu is null
UI7DrawList::Ref GetBackgroundList();
UI7DrawList::Ref GetList();
UI7DrawList::Ref GetForegroundList();
// Other Menu Specific Functions
float GetScrollingOffset();
void SetScrollingOffset(float off);
bool IsScrolling();
} // namespace Menu
// DrawLists
UI7DrawList::Ref GetForegroundList();