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

Does the createjs color property work on a dynamic textfield for html-canvas

Participant ,
Jul 23, 2019 Jul 23, 2019

Copy link to clipboard

Copied

Hi, Folks,

I'm using a dynamic textField created on the stage of an HTML-Canvas Doc. At run time I want it to change text color on the click of a button so I used the following code:

this.myTxt.text.color = "#E25FE8";

inside a click handler. Nothing happened.

I also tried:

console.log(this.myTxt.text.color )

I got "undefined".

However, some other methods and properties do work like

this.myTxt.text = "Mucho Love".

I might be doing something wrong

Does anyone tried doing something similar?

Views

602

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

correct answers 1 Correct answer

LEGEND , Jul 23, 2019 Jul 23, 2019

Given that you've demonstrated in your post that you're perfectly well aware that the "text" property of a dynamic textfield is a string that contains its textual content, why on Earth are you attempting to assign to myText.text.color instead of myTxt.color?

https://www.createjs.com/docs/easeljs/classes/Text.html

Votes

Translate

Translate
LEGEND ,
Jul 23, 2019 Jul 23, 2019

Copy link to clipboard

Copied

Given that you've demonstrated in your post that you're perfectly well aware that the "text" property of a dynamic textfield is a string that contains its textual content, why on Earth are you attempting to assign to myText.text.color instead of myTxt.color?

https://www.createjs.com/docs/easeljs/classes/Text.html

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
Participant ,
Jul 23, 2019 Jul 23, 2019

Copy link to clipboard

Copied

LATEST

I think you are right. I discovered my mistake earlier. Thank you for your polite reply. Have a nice day, sir

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