# Text

Let's just define an example

<pre class="language-javascript"><code class="lang-javascript"><strong>const text = new Text({
</strong>  "name": "test",//text name
  "position": {
    "x": 20,
    "y": 30
  },
  "layer": 100,//you don't have to type is automatically set to 100
  "color": "yellow",//text color
  "rotate": 0,//(you don't have to use it) example: 90
  "opacity": 1,//(you don't have to use it) can be max 1 and can be min 0
  "text": "Hello world!",
  "font": "Futura",//you do not have to enter a font, but you can enter a font
  "size": "20px"//instead of px you can use vh fln
})
</code></pre>

<figure><img src="https://644134079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAoN3PvLitJVdWdsmwATH%2Fuploads%2FNp2yf0FpXrVCVc5ifqVh%2Fresim_2023-07-30_165044710.png?alt=media&#x26;token=6019f1dd-ed27-4319-9e82-5e99155206f5" alt=""><figcaption></figcaption></figure>

## Position

<https://electoriaengine.gitbook.io/api/components/component/scale-and-position#position>

## Shadow,Rotate,Opacity

<https://electoriaengine.gitbook.io/api/components/component/texture#shadow>

## Update

<pre class="language-javascript"><code class="lang-javascript">text.update({
<strong>    text:"123 FPS"
</strong>})
//or 
updateData({
    name:"text",
<strong>    text:"123 FPS"
</strong>})
</code></pre>

## Get

{% code overflow="wrap" %}

```javascript
console.log(text.get())
console.log(getData("text"))
//Example
console.log(
text.get().text//example: 123 fps
)
```

{% endcode %}

## Remove

```javascript
text.remove()
removeData("text")
```
