@@ -1,12 +1,14 @@
|
||||
import Godot from "godot"
|
||||
import { useState } from "react"
|
||||
import { Component } from "react-godot-renderer"
|
||||
import TestUi1 from "./TestUi1"
|
||||
|
||||
|
||||
const HFlowContainer = Component.make(Godot.HFlowContainer)
|
||||
const VFlowContainer = Component.make(Godot.VFlowContainer)
|
||||
const Label = Component.make(Godot.Label)
|
||||
const CheckBox = Component.make(Godot.CheckBox)
|
||||
const TestUi1FC = Component.make(TestUi1)
|
||||
|
||||
export function TestUi2Component() {
|
||||
const [show, setShow] = useState(false)
|
||||
@@ -16,18 +18,16 @@ export function TestUi2Component() {
|
||||
|
||||
|
||||
return (
|
||||
<VFlowContainer>
|
||||
<HFlowContainer>
|
||||
<HFlowContainer>
|
||||
<VFlowContainer>
|
||||
<Label text="Show" />
|
||||
<CheckBox
|
||||
ref={checkBoxRef}
|
||||
button_pressed={show}
|
||||
/>
|
||||
</HFlowContainer>
|
||||
</VFlowContainer>
|
||||
|
||||
{show &&
|
||||
<Label text="Shown" />
|
||||
}
|
||||
</VFlowContainer>
|
||||
{show && <TestUi1FC />}
|
||||
</HFlowContainer>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user