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

Make ViewNode2 works #563

Open
ThibaudM opened this issue Oct 2, 2024 · 0 comments
Open

Make ViewNode2 works #563

ThibaudM opened this issue Oct 2, 2024 · 0 comments

Comments

@ThibaudM
Copy link

ThibaudM commented Oct 2, 2024

Hello,

Is it possible to have a working sample of the use of ViewNode2? It seems the code below almost works but it stops here because the texture stream is never updated.

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
    super.onViewCreated(view, savedInstanceState)

    val sceneView: SceneView = view.findViewById(R.id.sceneView)

    val windowManager = SceneView.createViewNodeManager(requireContext())
    sceneView.lifecycle = lifecycle
    sceneView.viewNodeWindowManager = windowManager

    val textView = TextView(context).apply {
        text = "Foobar"
        setTextColor(Color.BLACK)
        setBackgroundColor(Color.WHITE)
    }
    val node = ViewNode2(sceneView.engine, windowManager, sceneView.materialLoader, textView)
    sceneView.addChildNode(node)
    node.position = Float3(0f, 0f, -1f)
}

Screenshot_20241002-125338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant