Skip to content

Commit

Permalink
Add offset to rendered text in ObjectRenderSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
jobe-m committed Jul 24, 2024
1 parent f3cd9a3 commit c4e60d7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class ObjectRenderSystem(
// Rendering path for text
else if (entity has TextFieldComponent) {
val (text, fontName, textRangeStart, textRangeEnd, width, height, wordWrap, horizontalAlign, verticalAlign) = entity[TextFieldComponent]
val offset: Point = Point(offsetX, offsetY)

renderCtx2d(ctx) { render ->
var n = 0
Expand All @@ -130,7 +131,7 @@ class ObjectRenderSystem(
it.text,
it.font.lazyBitmap,
it.size,
it.pos,
it.pos + offset,
color = rgba,
baseline = true,
textRangeStart = textRangeStart - n,
Expand Down

0 comments on commit c4e60d7

Please sign in to comment.