Will there ever be a custom textbox?

Discussion and feedback on Construct 2

Post » Thu Feb 25, 2016 5:34 am

A plugin or feature to the program that allows you to edit the Textbox font and box image like you would a spritefont or sprite, would be very nice looking and useful on c2. Do you think this will ever be a feature or plugin in the future?
B
27
S
12
G
5
Posts: 79
Reputation: 5,223

Post » Thu Feb 25, 2016 7:17 am

A more customtizable textbox has been asked from Scirra as a future feature numerous times. I hope they make it for Construct 3.
B
137
S
33
G
17
Posts: 1,560
Reputation: 20,797

Post » Thu Feb 25, 2016 6:58 pm

Considering that construct 2 is not yet complete that would be ignorant to wait til construct 3 to add it if they are going to add it. How did Scirra respond and if they hadn't whats stopping them from doing so?
B
27
S
12
G
5
Posts: 79
Reputation: 5,223

Post » Thu Feb 25, 2016 7:04 pm

You can customize it with CSS. Make it borderless and transparent, then put over any fancy sprite and you have your magic done.
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Post » Thu Feb 25, 2016 7:21 pm

for custom textbox with CSS: Tutorial written by @colludium https://www.scirra.com/tutorials/1283/css-your-buttons-and-textboxes
Image Image
B
26
S
15
G
143
Posts: 881
Reputation: 74,560

Post » Thu Feb 25, 2016 8:45 pm

BackendFreak wrote:You can customize it with CSS. Make it borderless and transparent, then put over any fancy sprite and you have your magic done.

The problem with using that to constantly change a spritefont is that there is no insertion point. Even now that I had made an insertion point sprite It cannot select text or be moved by mouse. I cannot find a workaround to force it to do these things with sprites, but a plugin or feature that allows you to easily edit each moving and non-moving part of a textbox like you would a sprite would be absolutely perfect. Obviously plugins and features take a while so right now I'm trying to simulate it. What do you suggest I do to add text selection and insertion point and text movement to this? Any help would be great!
B
27
S
12
G
5
Posts: 79
Reputation: 5,223

Post » Fri Feb 26, 2016 7:29 am

BackendFreak wrote:You can customize it with CSS. Make it borderless and transparent, then put over any fancy sprite and you have your magic done.

But can we set custom formatting for just parts of the text? Like making just one word bold or draw it with different color?
B
137
S
33
G
17
Posts: 1,560
Reputation: 20,797

Post » Fri Feb 26, 2016 2:45 pm

glerikud wrote:But can we set custom formatting for just parts of the text? Like making just one word bold or draw it with different color?


Are we still talking about TextBox object? Can't really figure out any project where you would want to have different formatting for various words in the input field :). But anyway. No it is not possible to format only the part of the input text. You would have to do some hacks.
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Post » Fri Feb 26, 2016 3:05 pm

MorrisFeldman wrote:The problem with using that to constantly change a spritefont is that there is no insertion point. Even now that I had made an insertion point sprite It cannot select text or be moved by mouse. I cannot find a workaround to force it to do these things with sprites, but a plugin or feature that allows you to easily edit each moving and non-moving part of a textbox like you would a sprite would be absolutely perfect. Obviously plugins and features take a while so right now I'm trying to simulate it. What do you suggest I do to add text selection and insertion point and text movement to this? Any help would be great!


I think I don't fully understand what you want to achieve.

TextBox is an input field. It's basically an HTML input tag.
Code: Select all
<input type="{whatever}" name="{whatever}" id="{whatever}" />

And from this place you can style it with CSS as on HTML page. So basically you can do a formatting with CSS to make it look however you want to. So you can change a color, border, font, opacity etc. It's just about the way it is presented.

Now keep in mind that this tag have also an id attribute which allows you (C2 engine) to pick it individualy to work with it. So here we have JS (Java Script). With JS you can control the behaviour of elements. So this time it's not about the look but the functionality. In case of using C2 you don't have to use pure JS - C2 does it for you.

I just wanted to highlight that you do have the possibility to manipulate both the look and the functionality of this element. By default you cannot use sprite fonts as an input text, but with some portion of creativity you have possibility to hack it.

So if I understand you want to use sprife fonts as an input text and be able to highlight (select) this text with mouse etc.(?). Well that would require some tests to check what works what not.

For a first shoot I would put the input field transparent (no borders and shades).
1. Set input text transparent (same color as background). Now you have fully functioning TextBox, just nothing is visible.
2. Put a sprite font over text box (try to adjust sprite font size to be perfectly the same as the text in the TextBox).
3. Now set an event that whenever Input text changes it will copy the text value from the input box into the sprite font.

No idea how would it behave. Just a first thing in my mind.
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Post » Fri Feb 26, 2016 4:09 pm

BackendFreak wrote:Are we still talking about TextBox object? Can't really figure out any project where you would want to have different formatting for various words in the input field :). But anyway. No it is not possible to format only the part of the input text. You would have to do some hacks.

Oh, it seems I mixed it up with the normal text object. Sorry for that.
B
137
S
33
G
17
Posts: 1,560
Reputation: 20,797

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests