Skip to content

User Interface Systems and Tab System #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Rixium
Copy link

@Rixium Rixium commented May 6, 2020

  • 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.

@RonenNess
Copy link
Owner

RonenNess commented May 15, 2020

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!

@Rixium
Copy link
Author

Rixium commented May 21, 2020

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants