Skip to content

ViewNode2 not rendering #608

@PinkBabyBoy

Description

@PinkBabyBoy

Trying to do smth like this in template below. If use CubeNode - rendering is ok.

                    val cNode2 = ViewNode2(
                        engine,
                        wn.value,
                        materialLoader,
                        content = {
                            MaterialTheme {
                                Box(Modifier.fillMaxSize()) {
                                    Image(
                                        painterResource(ai.tourly.core.R.drawable.v_ic_microphone),
                                        null,
                                        modifier = Modifier.size(200.dp))
                                }
                            }
                        }
                    ).apply {
                        isPositionEditable = true
                        isScaleEditable = true
                        scale = Scale(2f, 2f, 2f)
                        isEditable = true
                        onEditingChanged = {
                            anchorNode.isVisible = true
                            isVisible = true
                        }
                     
                    }
                    val boundingBoxNode = CubeNode(
                        engine,
                        size = dev.romainguy.kotlin.math.Float3(200f, 200f, 200f),
                        center = dev.romainguy.kotlin.math.Float3(50f, 50f, 50f),
                        materialInstance = materialLoader.createColorInstance(
                            Color.Black.copy(
                                alpha = 0.5f
                            )
                        )
                    ).apply {
                        isVisible = true
                    }
                    anchorNode.addChildNode(cNode2)

                    anchorNode
                }
                nodes.addAll(ancors)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions