@@ -11,11 +11,6 @@ const Button = Component.fromClass(Godot.Button)
|
|||||||
export function TestUi1Component() {
|
export function TestUi1Component() {
|
||||||
const [text, setText] = useState("Default text")
|
const [text, setText] = useState("Default text")
|
||||||
|
|
||||||
const textEditRef = TextEdit.useRef()
|
|
||||||
Component.useSignal(textEditRef, "text_changed", function(this) {
|
|
||||||
setText(this.text)
|
|
||||||
})
|
|
||||||
|
|
||||||
const buttonRef = Button.useRef()
|
const buttonRef = Button.useRef()
|
||||||
Component.useSignal(buttonRef, "pressed", () => {
|
Component.useSignal(buttonRef, "pressed", () => {
|
||||||
console.log("Pressed!")
|
console.log("Pressed!")
|
||||||
@@ -33,10 +28,12 @@ export function TestUi1Component() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<TextEdit
|
<TextEdit
|
||||||
ref={textEditRef}
|
|
||||||
name="TextEdit"
|
name="TextEdit"
|
||||||
text={text}
|
text={text}
|
||||||
custom_minimum_size={new Vector2(200, 35)}
|
custom_minimum_size={new Vector2(200, 35)}
|
||||||
|
text_changed={function(this) {
|
||||||
|
setText(this.text)
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user