# How to turn this text format into Phaser CE text style?

**URL:** <https://phaser.discourse.group/t/how-to-turn-this-text-format-into-phaser-ce-text-style/12346>\
**Category:** Phaser 2 / CE\
**Created:** [September 23, 2022, 12:09pm UTC](https://phaser.discourse.group/t/how-to-turn-this-text-format-into-phaser-ce-text-style/12346 "2022-09-23T12:09:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spinnerbox](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/spinnerbox/32/6942_2.png) [@spinnerbox](https://phaser.discourse.group/u/spinnerbox)\
**Post date:** [September 23, 2022, 12:09pm UTC](https://phaser.discourse.group/t/how-to-turn-this-text-format-into-phaser-ce-text-style/12346/1 "2022-09-23T12:09:24Z")

</div>

I have this ActionScript 3 TextFormat settings:

```javascript
textFormat = new TextFormat();
textFormat.size = 15;
textFormat.font = "Arial";
textFormat.color = 0x000000;
textFormat.align = TextFormatAlign.CENTER;

buttonText = new TextField();
buttonText.selectable = false;
buttonText.defaultTextFormat = textFormat;
buttonText.mouseEnabled = false;
buttonText.tabEnabled = false;
buttonText.x = 2;
buttonText.y = 2;
buttonText.width = 65;
buttonText.height = 25;
buttonText.text = btnText;
btnRect.addChild(buttonText);

```

I tried this as per this page [Phaser.Text](https://photonstorm.github.io/phaser-ce/Phaser.Text.html):

```javascript
textStyleBasicButton = {
	font: 'normal 15pt Arial', 
	align: 'center', 
	fontStyle: 'normal', 
	fontSize: 15,
	fontWeight: 'normal',
	fill: '#000000',
	tabs: 0,
	testString: 'should be 65px wide and 25px high'
};

```

But I am not sure about the test string and about tabs. Is it ok?  
Also it would become selectable only if inputEnabled is set to true?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [September 24, 2022, 3:37pm UTC](https://phaser.discourse.group/t/how-to-turn-this-text-format-into-phaser-ce-text-style/12346/2 "2022-09-24T15:37:23Z")

</div>

What does it look like in ActionScript?

```javascript
const textStyleBasicButton = {
    font: '15pt Arial',
    fill: '#000000',
    boundsAlignH: 'center',
    boundsAlignV: 'middle'
};

const button = this.add.text(2, 2, 'Hello world', textStyleBasicButton);

button.setTextBounds(0, 0, 65, 25);

```

Phaser CE has no selectable text. Input would be the usual events (pointer up, pointer down, etc.).
