41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
#include <rlyson.h>
|
|
|
|
#include "raylib.h"
|
|
|
|
#include "raymath.h"
|
|
|
|
void DrawTextFull(
|
|
const Font font,
|
|
const char* text,
|
|
Vector2 origin,
|
|
const text_orientation_t orientation,
|
|
const float rotation,
|
|
const float fontSize,
|
|
const float spacing,
|
|
const float lineSpacing,
|
|
const Color tint
|
|
)
|
|
{
|
|
const Vector2 textSize = MeasureTextEx(font, text, fontSize, spacing);
|
|
|
|
const Vector2 pos = origin;
|
|
origin = (Vector2){0,0};
|
|
|
|
switch (orientation) {
|
|
case TEXT_ORIENTATION_LEFT:
|
|
origin.x += textSize.x;
|
|
break;
|
|
case TEXT_ORIENTATION_RIGHT:
|
|
break;
|
|
case TEXT_ORIENTATION_CENTER:
|
|
origin.x += (textSize.x / 2);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
origin.y += textSize.y / 2;
|
|
SetTextLineSpacing((int)lineSpacing);
|
|
|
|
DrawTextPro(font, text, pos, origin, rotation, fontSize, spacing, tint);
|
|
}
|