[Request] Text Object CSS support

0 favourites
  • 6 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • Was there any particular reason CSS is supported for form elements like Button or Textbox but not Text?

    It would be a huge boon for me to be able to style text objects directly for certain UI elements, rather than making a sprite or 9-patch to pin the text to and having to set up containers or manipulate them seperately.

  • +1 Yes, currently we can use the Set CSS Style action for form elements, but it would be better if the Text object could be formatted like that too.

    Also, an action to load a CSS file to format elements would be nice, since now we have to set up all CSS commands in seperate actions. If the webfont can be set from a CSS file, why not the formatting too?

  • Actually now I think it has to do with how text objects are rendered as part of the game while form objects are layered html elements on top of the game.

    Which is unfortunate as layers/blending modes can't be used properly in conjunction with form elements

    If that is the problem, would it be difficult to at least add border and background color settings/properties to the text object?

  • Form elements are HTML elements floating over the page, so can use CSS but not layering/blending/effects, whereas text objects are in the canvas so can't use CSS but can use layering/blending/effects.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Form elements are HTML elements floating over the page, so can use CSS but not layering/blending/effects, whereas text objects are in the canvas so can't use CSS but can use layering/blending/effects.

    Thanks for the clarification. I thought that the text object is also a HTML element.

  • That makes sense, thanks.

    Any chance to add some properties for the text object such as border, background, strikethrough/underline (while I'm at it maybe some wishful thinking like shadow and stroke)? Possibly for C3?

    The usage for me would be dynamic buttons, labels, or menu items as a single object. In the case of menu items if I need to clip a scroll-able menu to a part of the screen, I would use blending or layer something on top to cover the margins.

    Using a text and a sprite object together with containers is fine now, just a little clunky. As a beginner I definitely had some trouble wrapping my head around containers and how to use them properly though.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)