Made this crazy selection system

This commit is contained in:
2023-04-17 02:05:53 -04:00
parent 775390e884
commit 5ca3b80e8e
9 changed files with 251 additions and 10 deletions

View File

@@ -69,6 +69,10 @@ type ContainerEntity interface {
// index to a bounding rectangle.
PlaceChild (index int, bounds image.Rectangle)
// SelectChild marks a child as selected or unselected, if it is
// selectable.
SelectChild (index int, selected bool)
// ChildMinimumSize returns the minimum size of the child at the
// specified index.
ChildMinimumSize (index int) (width, height int)
@@ -94,6 +98,14 @@ type FocusableEntity interface {
FocusPrevious ()
}
// SelectableEntity is given to elements that support the Selectable interface.
type SelectableEntity interface {
Entity
// Selected returns whether this element is currently selected.
Selected () bool
}
// FlexibleEntity is given to elements that support the Flexible interface.
type FlexibleEntity interface {
Entity