GeonBit.UI icon indicating copy to clipboard operation
GeonBit.UI copied to clipboard

User Interface Systems and Tab System

Open Rixium opened this issue 5 years ago • 2 comments

  • Adds the concept of systems to the user interface.

  • Adds the tab system.

  • Added a new text validator that the tab system utilizes to ignore certain key presses.

Tab System

Add a list of entities to the tab system, and you can then press tab to cycle through them.

Reason

I was making a personal project and added something that didn't exist, according to the documentation. I'm not entirely sure of the implementation, but it works from what I can tell. It might have some unwanted side effects, but I thought I'd add a pull request, just in case you like the look of it so far.

Rixium avatar May 06 '20 18:05 Rixium

Hi @Rixium , thank you for this PR!

Just wondering, what did you mean by this:

"It might have some unwanted side effects"

Also can you please provide a minimal usage example so it will be easier for me to test / understand how to use it?

Thanks!

RonenNess avatar May 15 '20 10:05 RonenNess

Hi @Rixium , thank you for this PR!

Just wondering, what did you mean by this:

"It might have some unwanted side effects"

Also can you please provide a minimal usage example so it will be easier for me to test / understand how to use it?

Thanks!

Basically, I don't know the full extent of your library, so I'm not sure if changing things such as ActiveEntity will have an unwanted effect elsewhere.

I created it so I could tab through input fields and buttons on a form. Below I create a tab list and pass in the desired entities that can be tabbed through. The color defines the color of the entity when it's the active tabbed entity.

TabList tabList = new TabList(new Entity[] { inputField, inputField2, loginButton }, Color.Yellow * 0.9f);

You then add the tab list to the user interfaces systems, which are updated every update.

UserInterface.Active.AddSystem(tabList);

Rixium avatar May 21 '20 09:05 Rixium