mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
added custom caption to items. fixed glyph render.
This commit is contained in:
parent
8489c36df7
commit
b4b49ccd83
3 changed files with 97 additions and 57 deletions
|
|
@ -57,6 +57,14 @@ static inline void draw_glyph(
|
|||
const FontStyle& style
|
||||
) {
|
||||
for (int i = 0; i <= style.bold; i++) {
|
||||
glm::vec4 color;
|
||||
|
||||
if (style.color == glm::vec4(1, 1, 1, 1)) {
|
||||
color = batch.getColor();
|
||||
} else {
|
||||
color = style.color;
|
||||
}
|
||||
|
||||
batch.sprite(
|
||||
pos.x + (offset.x + i / (right.x/glyphInterval/2.0f)) * right.x,
|
||||
pos.y + offset.y * right.y,
|
||||
|
|
@ -65,7 +73,7 @@ static inline void draw_glyph(
|
|||
-0.15f * style.italic,
|
||||
16,
|
||||
c,
|
||||
batch.getColor() * style.color
|
||||
color
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -81,6 +89,15 @@ static inline void draw_glyph(
|
|||
const FontStyle& style
|
||||
) {
|
||||
for (int i = 0; i <= style.bold; i++) {
|
||||
glm::vec4 color;
|
||||
|
||||
if (style.color == glm::vec4(1, 1, 1, 1)) {
|
||||
color = batch.getColor();
|
||||
} else {
|
||||
color = style.color;
|
||||
}
|
||||
|
||||
|
||||
batch.sprite(
|
||||
pos + right * (offset.x + i) + up * offset.y,
|
||||
up, right / glyphInterval,
|
||||
|
|
@ -88,7 +105,7 @@ static inline void draw_glyph(
|
|||
0.5f,
|
||||
16,
|
||||
c,
|
||||
batch.getColor() * style.color
|
||||
color
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue