Skip to main content
Participant
Dec 15, 2021 2:22 PM UTC
Question

[plugin development] create text object with attribut center

Hello everybody,
I am developing a custom plugin for adobe xd. It's a discovery for me. I'm creating a Text() object and would like to give it an "align = center" attribute. Is it possible ? I can't find it in the API.
my code:

    const txtPage = new Text();
    txtPage.text = "PAGE";
    txtPage.styleRanges = [{
        length: txtPage.text.length,
        fontFamily: "Montserrat",
        fontStyle: "Bold",
        fill: new Color("#2699FB"),
        fontSize: 24
    }];

 

 

 

Thanks in advance 🙂

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Harshika Verma
Community Manager
Community Manager
Dec 21, 2021 1:12 PM UTC

Hi landiiv,

 

Thankyou for reaching out and sorry for the delay in response. Could you please check if this works https://www.adobe.io/xd/uxp/develop/reference/Text/#textalign? 

 

We are here to help.

 

Thanks,

Harshika

Translate
landiivAuthor
Participant
Dec 22, 2021 10:38 AM UTC

Thank you @HARSHIKA_VERMA 🙂

I had tried this before, maybe I did it wrong. I will try again as soon as possible.

Thank you and happy holidays!

Translate
Harshika Verma
Community Manager
Community Manager
Dec 22, 2021 1:02 PM UTC

Great. Please let us know if you need further assistance.

 

We would be happy to help.

 

Thanks,

Harshika

Translate