How do I add spacing within BBcode?

  • Is it possible to add blank spacing within BBcode?

    So that the Background color actually extends out.

    [background=#000000] change background color [/background]

    Does anybody knows if using too much BBcode actually drain too much resources or it's pretty harmless in general? TIA!

  • Hi, what's the point of doing this?

    For BBCode, I don't think so....

  • the bbcode is basically a inline style added to the object in html5 would look something like this

    <div id="sprite" style="background:#000000;"></div>

    where style=""background:#000000" would be your bbcode.

    the inline style is not really recommended for websites as they might interfere with the style.css and cause styles to overlap or display wrong or throwing errors that might affect the loading time, but for games made in Construct shouldn't create resource issues, or css style issues since there is no style attached to the objects you give that bbcode by default, and if there is Construct probably has some script that replaces the existing style by default with the one you input using bbcode, so it's pretty much harmless. - well Ashley answered this one, seems is not working as i was thinking.

    as for the space inside bbcode to expand the area im not sure what you mean.

    If you are exporting for html5 you can open the index.html inside the zip folder you get, and inside the header of the index.html you can add this

    <style>
    body {background:#000000;}</style>
    

    and if you want to have a background image you change it to

    <style>
    body {background: url('image.jpg'); background-size:cover;}
    </style>
    
  • The Text and SpriteFont objects don't use CSS, so none of the CSS styling considerations are relevant. They render directly in to the canvas instead of using DOM elements.

    You can probably use special characters like a non-breaking space to get blank spaces which still fill the background color. You could also try the [hide] tag.

  • The Text and SpriteFont objects don't use CSS, so none of the CSS styling considerations are relevant. They render directly in to the canvas instead of using DOM elements.

    You can probably use special characters like a non-breaking space to get blank spaces which still fill the background color. You could also try the [hide] tag.

    Thanks for the suggestions. Played around and doesn't seems to work.

    The [hide] tag doesn't work. Once you hide, the background color doesn't apply anymore.

    [background=#000000][hide]Extra Padding[/hide]change background color[/background]

    If I hide the word "background", there will be an empty gap without the background color.

    Tried the special characters but & nbsp; or & #160; or U+00A0 but is showing up as normal text instead of a non-breaking space.

    [background=#000000]& nbsp; change background color & nbsp;[/background]

    Is this what you meant though?

  • [background=#000000]& nbsp; change background color & nbsp;[/background]

    Is this what you meant though?

    No. BBCode does not understand HTML entities like & nbsp; - those are a feature of HTML. You'll need to directly copy and paste in the real character.

  • > [background=#000000]& nbsp; change background color & nbsp;[/background]

    > Is this what you meant though?

    No. BBCode does not understand HTML entities like & nbsp; - those are a feature of HTML. You'll need to directly copy and paste in the real character.

    Can you kindly show me a quick example? I'm not sure what you meant by real character.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • asdzxc You can try copying/pasting characters from this post:

    stackoverflow.com/questions/17978720/invisible-characters-ascii

    But, actually, I don't understand why you need it. For me, regular spaces work just fine:

  • Regular spacing doesn't seems to work at the end of a sentence when I append the text

    Set Text: "[background=#000000] Change background color " & newline & " and text color! [/background]"

    or

    Set Text: "[background=#000000] Change background color [/background]"

    Append Text: "[background=#000000] and text color! [/background]"

  • The text wrapping engine collapses whitespace at the end of a line, because for normal text layout you generally don't want that to affect text wrapping. You can work around it by adding non-whitespace characters set to the background color, so they are rendered but don't visibly appear. E.g. [background=#00ff00]Text[color=#00ff00]____[/color][/background]

    Since the ____ bit is green text on a green background, it isn't visible, but always occupies space.

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