formating; alyson licence; Camera2D
This commit is contained in:
parent
04d7c97e93
commit
39abfaa978
6 changed files with 85 additions and 49 deletions
|
@ -1,46 +1,46 @@
|
|||
|
||||
#include <rlyson.h>
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include "raymath.h"
|
||||
|
||||
void DrawTextFull(
|
||||
Font font,
|
||||
const char *text,
|
||||
Vector2 origin,
|
||||
text_orientation_t orientation,
|
||||
float rotation,
|
||||
float fontSize,
|
||||
float spacing,
|
||||
float lineSpacing,
|
||||
Color tint
|
||||
)
|
||||
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
|
||||
)
|
||||
{
|
||||
Vector2 textSize = MeasureTextEx(font, text, fontSize, spacing);
|
||||
const Vector2 textSize = MeasureTextEx(font, text, fontSize, spacing);
|
||||
|
||||
DrawCircleV(origin, 10, RED);
|
||||
|
||||
Vector2 pos = origin;
|
||||
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;
|
||||
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;
|
||||
|
||||
DrawCircleV(Vector2Add(origin, pos), 10, DARKGREEN);
|
||||
|
||||
SetTextLineSpacing(lineSpacing);
|
||||
SetTextLineSpacing((int)lineSpacing);
|
||||
|
||||
DrawTextPro(font, text, pos, origin, rotation, fontSize, spacing, tint);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue