Sign in to follow this  
_Zac_

updateText not defined in pixi.ts

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.