Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Txt Nodes can't tranform position when they're placed inside another Txt node #1132

Open
IntangibleMatter opened this issue Nov 13, 2024 · 0 comments
Assignees
Labels
b-bug Something isn't working

Comments

@IntangibleMatter
Copy link

Describe the bug
When a Txt node is set as a child of another node (Txt is known to have this issue, there may be others but I haven't tested enough), its position will not update if modified.

To Reproduce

export default makeScene2D(function* (view) {
  const text = createRef<Txt>();
  const text_split = createRefArray<Txt>();
  view.add(
    <BTxt
      ref={text}
      fontSize={150}
      textAlign={"center"}
      position={[0, 0]}
    >
      {"This is a test".split(" ").map((word) => (
        <Txt
          ref={text_split}
          text={word + " "}
          opacity={0}
          y={16}
          scale={[0.6, 1.5]}
          offsetY={1}
        />
      ))}
    </BTxt>,
  );
  yield* sequence(
    0.1,
    ...text_split.map((word) =>
      any(
        word.opacity(1, 0.12), // works
        word.scale([1, 1], 0.12), // works
        word.position.y(0, 0.12), // doesn't change anything
        word.offset.y(0, 0.12), // doesn't change anything
      ),
    ),
  );
});

Expected behavior

The text should be able to change its position or offset, but it doesn't

Package versions:
Click on the version in the bottom right corner to copy the versions

  • core: 3.17.0
  • two: 3.17.1
  • ui: 3.17.0
  • vitePlugin: 3.17.0

Additional context

This makes it nearly impossible to animate "nice text transitions" like those seen commonly in games for dialogue.

@IntangibleMatter IntangibleMatter added the b-bug Something isn't working label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants