I have a text object with the text: Hello World!
This is aligned left and the object is set to bbcode.
I have a sprite that when clicked should align the text center.
EVENT
Touch--> Sprite
ACTION
TextObject.style.textAlign = 'center';
I also found this example but could not seem to get it to work. Do I need the line with const and the EventListener?
const TextObject = document.queryselection('.text p');
const Sprite = document.queryselection('.align-center');
Sprite.addEventListener('click', function() {
TextObject.style.textAlign = 'center';
})