Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:objects:text_entry [2018/10/10 20:24]
valiant_curiosity [Display value using a text object]
gdevelop5:objects:text_entry [2019/06/13 14:13]
piyushpalawat99
Line 1: Line 1:
  
 # Text entry object # Text entry object
 +
 +<note tip>**See it in action!** 🎮\\
 +[[#Examples|I would rather see the Sprite object examples! Please take me there now.]]
 +</note>
  
 The text entry object captures user input and stores it in memory. You can use this object to simulate text input fields. For example, you might use the text entry object to provide a way that the player of your game can enter his/her name or any other information. The text entry object captures user input and stores it in memory. You can use this object to simulate text input fields. For example, you might use the text entry object to provide a way that the player of your game can enter his/her name or any other information.
Line 6: Line 10:
 ==== Add text entry object ==== ==== Add text entry object ====
  
-After creating a new object from the Objects Editor list, select "Text entry" from displayed the list of choices+After creating a new object from the Objects Editor list, select "Text entry" from the displayed list of choices 
 {{ :gdevelop5:objects:add-text-entry-object.png?nolink }} {{ :gdevelop5:objects:add-text-entry-object.png?nolink }}
  
Line 16: Line 21:
  
 First, add a Text Object to the scene. Then, add an event to modify the content of the Text object: First, add a Text Object to the scene. Then, add an event to modify the content of the Text object:
 +
 {{ :gdevelop5:objects:text-entry-object-display-value.png?nolink }} {{ :gdevelop5:objects:text-entry-object-display-value.png?nolink }}
  
 For the last parameter, which is the new content for the text, use the expression mentioned above: For the last parameter, which is the new content for the text, use the expression mentioned above:
-{{ :gdevelop5:objects:text-text-entry.png?nolink&400 |}}+{{ :gdevelop5:objects:text-text-entry.png?nolink |}}
  
-//Note that __Entry__ should be the name of the Text Entry object. You need to replace this with the name of your Text Entry object.//+<note>__Entry__ should be the name of the Text Entry object. You need to replace this with the name of your Text Entry object.</note>
  
 Now if you run a scene preview. Start typing you will see the text object displaying whatever you type. Now if you run a scene preview. Start typing you will see the text object displaying whatever you type.
  
 Using events, it is possible to enable or disable the "Text entry" object. Events also allow you to control when to capture text input and when not to capture text input. Using events, it is possible to enable or disable the "Text entry" object. Events also allow you to control when to capture text input and when not to capture text input.
 +
 +{{:gdevelop5:objects:textentryobjectevents.png|}}
  
  
Line 33: Line 41:
 Open these examples online.</note> Open these examples online.</note>
  
-{{ :gdevelop5:objects:textexample.png?400 |}}+{{:gdevelop5:objects:textexample.png?|}}
  
 * https://editor.gdevelop-app.com/?project=example://text-entry-object * https://editor.gdevelop-app.com/?project=example://text-entry-object
-