Nagaraju Posted December 19, 2019 Share Posted December 19, 2019 Hello, I have been trying to add underline for text but could not able to get it done. I will also have multi lines of text sometimes. Is there any solution or predefined methods in pixi to achieve this? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 19, 2019 Share Posted December 19, 2019 That's the only thread I see for text underline style: https://github.com/pixijs/pixi.js/issues/5269 Quote Link to comment Share on other sites More sharing options...
jonforum Posted December 19, 2019 Share Posted December 19, 2019 (edited) Ya true not possible in canvas with text-decoration, but with pixijs, it maybe possible to add a special case. Example tricks here with canvas text apihttp://jsfiddle.net/durgesh0000/KabZG/ Edited December 19, 2019 by jonforum Quote Link to comment Share on other sites More sharing options...
jonforum Posted December 19, 2019 Share Posted December 19, 2019 (edited) btw , also here a fake way for simple one line text. In case you just need it for link.https://www.pixiplayground.com/#/edit/C4x9zQ0DXbR7RNUtX-YDxEdit: if your interest to perform this on multiLine , It will be easy with use of text metric. PIXI.TextMetrics.measureText(string, style, isWordWrap) Text metric will stock for you all lineWidth and lines inside arrays. Than you will can perform a map on line like the upper demo show you. Edited December 19, 2019 by jonforum themoonrat 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.