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

Change dynamic textbox background colour

New Here ,
May 02, 2023 May 02, 2023

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!

538
Translate
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

Translate
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

Translate
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

Thanks JC

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

Kind regards 

Matt

Translate
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
LATEST

You're welcome!

 

And thanks for letting us know.

Translate
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