Skip to content

Component overview

Stanislav edited this page Dec 6, 2021 · 7 revisions

GUI Engine makes no sense without components.

As stated earlier, components should be built using Builders, which are descendants of ComponentBuilder. To build a component you should get nesessary builder, set all you need and build component. But what can you set? What functionality each component provide? You can see a short entry for everything that exists in GExt in the list below.

Note: you can set position and size to any component. Builder syntax is:

component = Graphics.<component_name>
    ...
    .size(...)
    .placeAt(...)
    .build();

Main

A couple of bright

Independent components that could be used directly in the user interface.

GLabel

Just a plain single-line text on the screen. In the other words, the string API adaptation.

Additionally: color, custom font renderer, text scale, is string should be centered.

GButton

Represents clickable button. Label and action to each mouse button can be attached. Additionally, you can set texture mapping that should be displayed at the background of the button.

GRadioButton

Shows a list of points, but only one can be selected. The size of checkbox and interval between lines can be specified.

GImage

Plain image API adaptation. In addition to the basic settings, you can only specify the image.

GBackground

Represents GUI background drawn according to style rules. Border and corner thickness should be set.

GCheckBox

Just a plain checkbox implementation. It will show checkbox and user can tick it and untick.

GProgressBar

General implementation of progress bar. You can set and get progress in format: float number from 0 to 1.

GTextPanel

Represents user-immutable multiline text box. Provides methods for working with text, but doesn't support keybindings. Supported features:

  • working with content from code
  • selection by mouse dragging
  • copying selected content
  • content wrapping(computing the size of the content and expanding panel to cover it)

Text panel is first really complex component developed on the GExt platform. And of course, it has many parameters that you can set:

  • generally, text
  • internal offsets
  • enable/disable selection
  • custom renderer
  • text scale
  • etc.

GTextBox

Represents fully mutable multiline text box and extends GTextPanel.

Note: this component is still in beta. Some functions can behave wrongly. Please submit fatal errors on GitHub.

Supported features:

  • basic text editing
  • working with transfer buffer (Ctrl+C, Ctrl+V)
  • selection by Shift + arrows
  • advanced navigation (arrows in selection, Home-End, PageUp-PageDown)

Coming soon:

  • editing history (Ctrl+Z, Ctrl+Shift+Z)
  • scrolling feature

Controls

A darker one

Components generally without self graphics representation. It defines some behaviour around of management other components.

GScroll*

Enables scrolling on supported components when attaching to it.

GSelector

Controls selection process on targeted component.

Clone this wiki locally