PIXI-v8 Text #11425
Unanswered
RomanMiniv
asked this question in
v8 General
PIXI-v8 Text
#11425
Replies: 1 comment 4 replies
-
There are a lot of ways to handle this, but in general, the approach here I wouldn't recommend and would consider an anti-pattern for Pixi rendering. When Pixi renders text elements, it owns the entire lifecycle of the underlying Texture. Attempting to add additional elements to the canvas, opens a lot of problems. Instead, I might suggest one of two options:
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My issue is that when the Text class itself managed the canvas into which it renders the text (PIXI-v6), I could intercept it and make some changes to the text and its style, which I could then rerender on its own canvas. Now in PIXI-v8 there is no such possibility, how can I do it?
ChatGPT generated this example, it is correct in terms of logic and what I want, but the code does not work of course.
That is, what I want, when the Pixi Text object is created, I intercept this moment or extend it and add my next behavior: if the text contains the word "hello", then I personally add the word "world" in the Text class and place it at a certain composition, that is, at certain positions, with certain styles, etc. - I modify the texture of the Text class, where only passed the word "hello".
Ideally, I want to achieve this by extending the Text class so as not to add additional abstraction, but if there is no other way, I would be happy with this option!
I would be happy for any help!
Beta Was this translation helpful? Give feedback.
All reactions