ppy / osu-framework

A game framework written with osu! in mind.
MIT License
1.67k stars 419 forks source link

Add MultilineTextBox component #1618

Open Aergwyn opened 6 years ago

Aergwyn commented 6 years ago

As I need this and was tinkering with it I thought this is an opportunity to open an issue to ask questions before I open a PR in the coming days. My tinkering consisted of copying the entire TextBox and see if it's feasible with my knowledge to do this.

I managed

I need to figure out

Question time:

Of course this won't ask/answer everything as code should be available for that but something fundamental (like the first question) may already be answered beforehand.

peppy commented 6 years ago

Where should it be?

I'm not sure if we want to increase the complexity of the TextBox class beyond how complex it is already. It should likely be refactored before attempting this. I'd have to see a sample implementation to decide whether it would be part of TextBox or TextBoxMultiline : TextBox, though.

What additional keys does it have to handle?

The ones you specify would be a fine start.

Does it need a scrollbar or any visual indicator that there is text outside of our vision?

Yes. It will be used for editing longer articles like forum posts.

Aergwyn commented 6 years ago

It should likely be refactored before attempting this.

Could you elaborate on this? Is there something wrong with the TextBox itself? Would there be a specific goal with the refactoring?

peppy commented 6 years ago

I thin splitting individual visual components into their own classes would be a good start, if that isn't done yet. ie. Caret and SelectionArea. And trying to move logic in those classes where possible.

frenzibyte commented 4 years ago

I'll work on this.

frenzibyte commented 4 years ago

Unassigning myself for now as it is a low priority from being worked on.