• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[plugin development] create text object with attribut center

New Here ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

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
    }];

aligncenter.png

 

 

 

Thanks in advance 🙂

TOPICS
Plug-ins

Views

327

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 21, 2021 Dec 21, 2021

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 22, 2021 Dec 22, 2021

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 22, 2021 Dec 22, 2021

Copy link to clipboard

Copied

LATEST

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

 

We would be happy to help.

 

Thanks,

Harshika

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines