_Zac_ Posted February 18, 2020 Share Posted February 18, 2020 Hello, I am trying to create a text that renders to the Rope class. let test = new PIXI.Text("Hello my name is computer", {fontSize:28}); test.updateText(); console.log(test); let rope = new Knotz(test, [new PIXI.Point(0,0), new PIXI.Point(10,0),new PIXI.Point(0,10),new PIXI.Point(20,0)]); The problem is updateText() is not a function within the pixi.ts. If I dont call updateText it does not force the texture of Text to update. The result is I bind a texture to the rope that has a width and height of 0. Any work arounds? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 18, 2020 Share Posted February 18, 2020 which version of pixi do you use? Quote Link to comment Share on other sites More sharing options...
_Zac_ Posted February 19, 2020 Author Share Posted February 19, 2020 (edited) I tried 5.2.1 and 5.1.6. I was not able to find the updateText function in both versions. Edited February 19, 2020 by _Zac_ Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 20, 2020 Share Posted February 20, 2020 Oh, I've got it I didnt see that you use TS, my fault. The function is private.https://github.com/pixijs/pixi.js/blob/295495bd46b6dc2df736e374f272b0bb3e1c6ee2/packages/text/src/Text.ts#L143 You can complain about it in pixijs issues or even make PR to unprivate it. Just mention that there are threads where people recommend to use this function from outside. For now just use "as any" Before you ask "why didnt pixijs team think about that", look in other places - many functions of ThreeJS are scope-locked, no way to get to them! Quote Link to comment Share on other sites More sharing options...
themoonrat Posted February 20, 2020 Share Posted February 20, 2020 I've added a pr to make updateText public! 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.