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