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

Dynamic Text in button states (HTML5 Canvas on PC)

Engaged ,
May 25, 2018 May 25, 2018

Hey folk,

are there restrictions around Dynamic Text in button states in HTML5?

In a simple button I have Dynamic Text in the 'Up' state. I press F6 in the 'Over' state then change that same Dynamic Text font (plus sort out the 'Hit' area) but when I test this it doesnt change for the 'Over' state when previewed or when tested on our server. It stays the same style as the 'Up' state.

An example button would be Roboto Regular 24pt on some text in the 'Up' state and then Roboto Black 24pt for the same text (but new keyframe) in the 'Over' state. I have Dynamic Text selected for both and the typeface (family) is selected from the Web Fonts area drop down (with an 'F' beside them). The 'Over' state in preview does not show the Black style when hovered over in preview.

In the above example if I changed the 'Over' font colour then that colour change shows in preview but still the 'Over' state style stays as Regular.

I've reset preferences, plus tried on my home PC and work PC with no difference. Also tested on Chrome, Firefox and Microsoft Edge. Animate CC is most recent version.

Maybe I've missed something really simple or it is just the way it is?

The explanation is a bit long winded but hope it gives a clear picture.

It's not the end of the world but thought I'd like to know for future.

Cheers

Greg

1.1K
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 25, 2018 May 25, 2018

Oh sorry.

I misunderstood.

It's far from the ideal solution, but what you can do is to put the text in the over state inside of a Movie Clip.

Apparently, CreateJS don't set text fields the way we expect in frames other than the first.

I kinda tried to explain my point here:

Dynamic text update problem

I hope it helps.

Regards,

JC

Translate
Community Expert ,
May 25, 2018 May 25, 2018

Hi.

Draw a rectangle in the hit frame to be used as the hit area.

Because if you put only the text, it will be very hard to detect the mouse hovering over.

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
Engaged ,
May 25, 2018 May 25, 2018

Hi and thanks for that but I do that anyway. I should have added that to original text (I'd waffled on long enough ha ha). But that is not the problem.

Cheers

Greg

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 25, 2018 May 25, 2018

Oh sorry.

I misunderstood.

It's far from the ideal solution, but what you can do is to put the text in the over state inside of a Movie Clip.

Apparently, CreateJS don't set text fields the way we expect in frames other than the first.

I kinda tried to explain my point here:

Dynamic text update problem

I hope it helps.

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
Engaged ,
May 25, 2018 May 25, 2018

Thanks João, that's perfect. I converted the 'Over' state text to a movie clip and it works at no expense to the file size.

I do think maybe it is a potential bug- not a big one and with a quick work around.

kglad was correct but I'll mark yours as correct, as you took the time in the other post to gave great detail and explanation (as always).

Thanks again, João.

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 25, 2018 May 25, 2018

That's excellent!

You're welcome and I do appreciate your feedback.

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
Engaged ,
May 25, 2018 May 25, 2018
LATEST

No worries, João.

I was a bit hasty with my response, as there is a small pay off in file size with converting to symbols. But very small and a lot better than if all the text in the buttons had been static.

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 25, 2018 May 25, 2018

use static text in a button.

if you need dynamic text, use a movieclip button.

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
Engaged ,
May 25, 2018 May 25, 2018

Ah right cheers. I was wondering if that is the only solution.

I'm trying to squeeze the file size down as much as possible (I've become obsessed with file size, performance and the users experience) where I can and hence using Dynamic Text for multiple buttons helps that- even if small file size saving.

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