Virtual keyboard

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RetroDan007
:warning: Old Version Published before Godot 3 was released.

Hello everyone.
I am creating a calculator as practice.
And I ready design it.
I created custom buttons in blender ,
And GODOT and implemented by the node
TextureButton . To put a sprite screen as background and an empty Label,
It is this correct , or suggest me something else.

My questions are:

  1. How do I make a button that when tighten show the number
    Example : 1,2,3,4,5,6,7,8,9,10
    I did this for the button 1 and 2:
    _on_1_pressed func ():
    get_node ( " Label" ) . set_text ( “1” )

_on_2_pressed func ():
get_node ( " Label" ) . set_text ( “2”)

The problem is that it is linked to the previous ,
Gritted 1 leaves 1 2 squeezed out .

I want to add example : 1 then 2 gritted out 12

Well I hope answers XD. Then come my other questions LOL
Help with this please .

My left a project links to download it .

:bust_in_silhouette: Reply From: mateusak

Like a virtual keyboard? You can do

var Node = get_node("Label")
Node.set_text(str(Node.get_text(), "1"))

This way when you press “1” it’ll add, and not replace.

Some hints about questioning:

  1. Do not use vague titles such as “Godot Script”
  2. When giving code samples, select the code and click on the two
    brackets where is the bold and italic buttons as well.
  3. Be direct and try to make your text as legible as possible.
  4. If you get your answer click on the circle with the “V” to mark it
    as best answer. This way you prevent other people from entering here
    thinking you still need help.

Invalid call to function ‘set_text’ in base ‘Label’. Expected 1 arguments.

 extends Node

# member variables here, example:
# var a=2
# var b="textvar"
var memory_01
var signo
var memory_02

func _ready():
	# Called every time the node is added to the scene.
	# Initialization here
	pass
	

func _on_1_pressed():
	var Node = get_node("Label")
	Node.set_text(Node.get_text(),"1")
	e

func _on_2_pressed():
	var Node = get_node("Label")
	Node.set_text(Node.get_text(),"2")

func _on_3_pressed():
	var Node = get_node("Label")
	Node.set_text(Node.get_text(),"3")

RetroDan007 | 2016-05-11 00:41

Try

var Node = get_node("Label")
Node.set_text(str(Node.get_text(), "1"))

mateusak | 2016-05-11 03:27