Skip to content

Commit

Permalink
chore: re introduce uitext wrapping (#6228)
Browse files Browse the repository at this point in the history
Re-introduced ui text wrap with no-wrap as the default behavior
  • Loading branch information
AlejandroAlvarezMelucciDCL committed Jun 28, 2024
1 parent 0c17644 commit f782a12
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 15 deletions.
14 changes: 7 additions & 7 deletions scripts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"typescript": "^4.2.3"
},
"dependencies": {
"@dcl/protocol": "^1.0.0-9115457439.commit-926ebd1",
"@dcl/protocol": "^1.0.0-9466805132.commit-365e0bb",
"@protobuf-ts/protoc": "^2.8.2",
"@types/fs-extra": "^11.0.1",
"@types/glob": "^8.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ public void OnComponentRemoved(IParcelScene scene, IDCLEntity entity)

public void OnComponentModelUpdated(IParcelScene scene, IDCLEntity entity, PBUiText model)
{
var wrapMode = WhiteSpace.NoWrap; // Default mode is No Wrap enabled

if (model.HasTextWrap && model.TextWrap == TextWrap.TwWrap)
wrapMode = WhiteSpace.Normal;

uiElement.text = model.Value;
uiElement.style.whiteSpace = wrapMode;
uiElement.style.color = model.GetColor().ToUnityColor();
uiElement.style.fontSize = model.GetFontSize();
uiElement.style.unityTextAlign = model.GetTextAlign().ToUnityTextAlign();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f782a12

Please sign in to comment.