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

Change dynamic textbox background colour

New Here ,
May 02, 2023 May 02, 2023

Copy link to clipboard

Copied

Any ideas how to make the text box display a background? The font changes but the background doesn't.

 if (displayedItem === _this.display.text) { 
     textBox.text = `${displayedItem} ${fuelOrder}`;     
  	 textBox.font = "23px Arial" // THIS WORKS
         textBox.background=true;
	 textBox.backgroundColor = "#00ff00";

Thanks!

Views

376

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

Community Expert , May 02, 2023 May 02, 2023

Hi.

 

I don't think CreateJS - or even canvas - implements a background property or method for text fields.

 

You'll have to do it manually by creating in author or run time a rectangle in the background that has the same size and position of the target text field instance.

 

Regards,

JC

Votes

Translate

Translate
Community Expert ,
May 02, 2023 May 02, 2023

Copy link to clipboard

Copied

Hi.

 

I don't think CreateJS - or even canvas - implements a background property or method for text fields.

 

You'll have to do it manually by creating in author or run time a rectangle in the background that has the same size and position of the target text field instance.

 

Regards,

JC

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 ,
May 02, 2023 May 02, 2023

Copy link to clipboard

Copied

Thanks JC

I ended up just hiding the thing behind which I was wanting to obscure.

Kind regards 

Matt

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
Community Expert ,
May 02, 2023 May 02, 2023

Copy link to clipboard

Copied

LATEST

You're welcome!

 

And thanks for letting us know.

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