Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
gdevelop5:objects:text_entry [2017/11/08 21:08] ddabrahim created |
gdevelop5:objects:text_entry [2020/12/26 13:56] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== What a text entry object | + | # Text entry object |
- | The text entry object | + | <note tip> |
+ | [[# | ||
+ | </ | ||
+ | |||
+ | The text entry object | ||
==== Add text entry object ==== | ==== Add text entry object ==== | ||
- | To add a text entry object | + | After creating |
- | You may need to scroll down on the list to find it | + | |
- | {{ : | + | |
- | After, rename the object to whatever you like and simply | + | {{ : |
- | You can learn more about expression on the wiki | + | Rename |
+ | |||
+ | Now, if you run a preview of the scene, all the keys you press are going to be captured by the object and stored in memory. In order to read the value from the memory, you need to use an expression like this one: `TextEntry.String()` (see an example below). | ||
==== Display value using a text object ==== | ==== Display value using a text object ==== | ||
- | Let add a text object | + | First, |
- | {{ : | + | |
+ | {{ : | ||
+ | |||
+ | For the last parameter, which is the new content for the text, use the expression mentioned above: | ||
+ | {{ : | ||
+ | |||
+ | < | ||
+ | |||
+ | 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. | ||
+ | |||
+ | {{: | ||
- | After we just simply need to use the above mentioned expression as the text | ||
- | {{ : | ||
- | //Note that, __text-entry__ is my choice of name for the text entry object. You need to replace that with the name of your text entry object.// | + | ## Examples |
- | Now if you run a preview and start typing you should see the text object displaying whatever you type. | + | <note tip> |
+ | Open these examples online.</ | ||
- | Using events we can enable, disable the text entry object whenever we want and control it this way when we actually capturing input and when not to. We can also modify the value stored in memory to anything we like. | + | {{: |
+ | * https:// |