Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align FlxText between all targets #2536

Merged
merged 1 commit into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions flixel/text/FlxText.hx
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,12 @@ class FlxText extends FlxSprite

return;
}
#elseif !web
// Fix to render desktop and mobile text in the same visual location as web
_matrix.translate(-1, -1); // left and up
graphic.draw(textField, _matrix);
_matrix.translate(1, 1); // return to center
return;
#end

graphic.draw(textField, _matrix);
Expand Down
2 changes: 1 addition & 1 deletion flixel/ui/FlxButton.hx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class FlxButton extends FlxTypedButton<FlxText>
super(X, Y, OnClick);

for (point in labelOffsets)
point.set(point.x - 1, point.y + 3);
point.set(point.x, point.y + 3);

initLabel(Text);
}
Expand Down