How do I add a background color to a "text" box?

0 favourites
  • 2 posts
From the Asset Store
Over 2700 files with all the colour combinations from a 15 colours palette!
  • I am using the text box a lot in my program. I don't mean the text box you can add text to, but rather the box that simply displays text. Is there a way in which I can automatically add a white background to the box?

    So far, the only solution I have come up with is adding a sprite of a white image behind the text - this however is a real pain, as I have a ton of boxes, and adding an image behind doesn't quite fit the proportions of the text box. Is there some plug in that can add a white background behind the text?

    Alternatively, I've tried using the "Text box" option. However, I cannot figure out how to get the line break to work. I write "Hello" & newline & "World." in the text section of the text box, but it displays ""Hello" & newline & "World."" I'd prefer to be able to use the "text" option, as that way I won't have to do all the line breaks manually, but I was wondering if there was some easy way to add a white box behind the text.

    Thanks!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There may be a way to do this with one of the custom plugins. Someone else will have to comment on that. But you can add the sprite backgrounds with just a few actions, and adjust them to line up with your text objects to your liking.

    I threw this together quickly, so it isn't pretty, but it should give you the idea.

    textBackgroundSprite.capx

    In the example the text objects are just different instances of the same text object. If you have a bunch of different text objects it is a bit more complicated because you have to do the work for each one of them--unless you have the paid version, in which case you may be able to use a family for all of your text objects.

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