[Sugestion] A better Textbox

0 favourites
  • 6 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • Official textbox object is very limited. It didn't have some important attributes like font type size ,color,border color, border size,padding.

    I tried some other unofficial textbox plugins. But they're not rendering correctly.

    <img src="https://dl.dropboxusercontent.com/u/70704903/ForumQuestions/20/textbox.png" border="0" />

  • I totally agree with this post

  • You can do all that with CSS. Use the "Set CSS Style" action to set "color", "font-size", "border-color", "background-color", etc.

  • Ramones is right on that. Due to the nature that TEXTBOX is fully a HTML DOM object and not a C2 object. This led to the design that the TextBox and all the DOM objects should be set by the CSS style. Also I hear you can copy/paste a CSS file into index.html to set the value of these.

    However as a personal note for game development. If you need text for a game you should be using SpriteFont and no DOM objects. The DOM objects should only be used for more application, form types of input screens.

    The reason for this is because DOM object are heavier on the renderer. Desktop computers can get away with this due to the amount of power. But it's still not the better design choice.

    If you need some diversity to SpriteFont. You can make a basic white font. Then apply a colour effect that can be modified run time. Also use larger sprites for the font; that way you can decrease the size without loss of resolution that you would get from upscaling.

    Finally another reason to NOT use TextBox and the entire DOM family for games. Is that browsers and O/S have effects on the font and font values used. While you can influence some control over this. it is likely that you would need to set numerous CSS settings to accomodate different browsers and OSs as needed.

  • Which begs the question why is there not a decent editbox available using the spritefont? I tend to roll my own but it would save much time if we could drop a components and set a bunch of parameters.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Which begs the question why is there not a decent editbox available using the spritefont? I tend to roll my own but it would save much time if we could drop a components and set a bunch of parameters.

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