[Sugestion] A better Textbox

Discussion and feedback on Construct 2

Post » Thu Nov 28, 2013 12:08 pm

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.

B
21
S
8
G
6
Posts: 177
Reputation: 8,134

Post » Thu Nov 28, 2013 12:33 pm

I totally agree with this post
B
9
S
2
G
1
Posts: 15
Reputation: 798

Post » Thu Nov 28, 2013 4:55 pm

You can do all that with CSS. Use the "Set CSS Style" action to set "color", "font-size", "border-color", "background-color", etc.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Thu Nov 28, 2013 5:23 pm

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.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Thu Nov 28, 2013 10:20 pm

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.czar2013-11-28 22:21:51
B
37
S
9
G
5
Posts: 437
Reputation: 6,094

Post » Thu Nov 28, 2013 10:21 pm

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.
B
37
S
9
G
5
Posts: 437
Reputation: 6,094


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests