Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Gui.ClosestDirectionFocusFinder Class Reference

Find closest widget to focus for directional navigation. More...

Inheritance diagram for Dragengine.Gui.ClosestDirectionFocusFinder:
Dragengine.Gui.MainMenus.Interactive.IMMInteract.IMMClosestDirectionFocusFinder

Public Member Functions

void addIgnoreWidget (Widget widget)
 Add widget to ignore list.
void addIgnoreWidgetFocusable (Widget widget)
 Add widget or first focusable parent if widget is not focusable.
RectArea getBestHitBox ()
 Best hit box or null.
Widget getBestHitWidget ()
 Best hit widget or null.
int getBestHitX ()
 Best hit box distance along X axis in pixels.
RectArea getBestNearestBox ()
 Best nearest box.
Widget getBestNearestWidget ()
 Best nearest widget or null.
int getBestNearestX ()
 Best nearest box distance along X axis in pixels.
Widget getBestWidget ()
 Best widget to use.
RectArea getOriginBox ()
 Origin box.
bool hasIgnoreWidget (Widget widget)
 Ignore widget is present.
ClosestDirectionFocusFinder new (int direction, Point position, Point size)
 Create finder for search direction.
void processWidget (Widget widget, Point position, Point size)
 Process widget.
void reset ()
 Reset finder.

Protected Member Functions

void challengeBest (Widget widget)
 Compare processed widget against best widget and keep the winner.

Protected Attributes

RectArea pBestHitBox
Widget pBestHitWidget
int pBestHitX
Point pDirY
RectArea pHitBox
Array pIgnoreWidgets
RectArea pOriginBox

Detailed Description

Find closest widget to focus for directional navigation.

Version
1.29

Member Function Documentation

◆ addIgnoreWidget()

void Dragengine.Gui.ClosestDirectionFocusFinder.addIgnoreWidget ( Widget widget)

Add widget to ignore list.

References new().

Referenced by getBestHitWidget().

◆ addIgnoreWidgetFocusable()

void Dragengine.Gui.ClosestDirectionFocusFinder.addIgnoreWidgetFocusable ( Widget widget)

Add widget or first focusable parent if widget is not focusable.

References new(), and pDirY.

Referenced by getBestHitX().

◆ challengeBest()

void Dragengine.Gui.ClosestDirectionFocusFinder.challengeBest ( Widget widget)
protected

◆ getBestHitBox()

RectArea Dragengine.Gui.ClosestDirectionFocusFinder.getBestHitBox ( )

Best hit box or null.

References pIgnoreWidgets.

Referenced by challengeBest().

◆ getBestHitWidget()

Widget Dragengine.Gui.ClosestDirectionFocusFinder.getBestHitWidget ( )

Best hit widget or null.

References addIgnoreWidget(), and new().

Referenced by challengeBest().

◆ getBestHitX()

int Dragengine.Gui.ClosestDirectionFocusFinder.getBestHitX ( )

Best hit box distance along X axis in pixels.

References addIgnoreWidgetFocusable().

Referenced by challengeBest().

◆ getBestNearestBox()

RectArea Dragengine.Gui.ClosestDirectionFocusFinder.getBestNearestBox ( )

Best nearest box.

Referenced by challengeBest().

◆ getBestNearestWidget()

Widget Dragengine.Gui.ClosestDirectionFocusFinder.getBestNearestWidget ( )

Best nearest widget or null.

References new().

Referenced by challengeBest().

◆ getBestNearestX()

int Dragengine.Gui.ClosestDirectionFocusFinder.getBestNearestX ( )

Best nearest box distance along X axis in pixels.

References pIgnoreWidgets.

Referenced by challengeBest().

◆ getBestWidget()

Widget Dragengine.Gui.ClosestDirectionFocusFinder.getBestWidget ( )

Best widget to use.

Referenced by challengeBest().

◆ getOriginBox()

RectArea Dragengine.Gui.ClosestDirectionFocusFinder.getOriginBox ( )

Origin box.

Referenced by challengeBest().

◆ hasIgnoreWidget()

bool Dragengine.Gui.ClosestDirectionFocusFinder.hasIgnoreWidget ( Widget widget)

Ignore widget is present.

References new(), and pDirY.

Referenced by challengeBest().

◆ new()

ClosestDirectionFocusFinder Dragengine.Gui.ClosestDirectionFocusFinder.new ( int direction,
Point position,
Point size )

Create finder for search direction.

Parameters
directionDirection as InputEventKey.arrowLeft, InputEventKey.arrowRight, InputEventKey.arrowUp or InputEventKey.arrowDown.
positionPosition of origin widget relative to origin.
sizeSize of origin widget.

References new(), and pDirY.

Referenced by addIgnoreWidget(), addIgnoreWidgetFocusable(), challengeBest(), getBestHitWidget(), getBestNearestWidget(), hasIgnoreWidget(), new(), processWidget(), and reset().

◆ processWidget()

void Dragengine.Gui.ClosestDirectionFocusFinder.processWidget ( Widget widget,
Point position,
Point size )

Process widget.

Parameters
widgetWidget to process.
positionPosition of widget relative to origin.
sizeSize of widget.

References new(), pIgnoreWidgets, and pOriginBox.

Referenced by challengeBest().

◆ reset()

void Dragengine.Gui.ClosestDirectionFocusFinder.reset ( )

Member Data Documentation

◆ pBestHitBox

RectArea Dragengine.Gui.ClosestDirectionFocusFinder.pBestHitBox
protected

Referenced by challengeBest().

◆ pBestHitWidget

Widget Dragengine.Gui.ClosestDirectionFocusFinder.pBestHitWidget
protected

Referenced by challengeBest().

◆ pBestHitX

int Dragengine.Gui.ClosestDirectionFocusFinder.pBestHitX
protected

Referenced by challengeBest().

◆ pDirY

Point Dragengine.Gui.ClosestDirectionFocusFinder.pDirY
protected

◆ pHitBox

RectArea Dragengine.Gui.ClosestDirectionFocusFinder.pHitBox
protected

Referenced by challengeBest().

◆ pIgnoreWidgets

Array Dragengine.Gui.ClosestDirectionFocusFinder.pIgnoreWidgets
protected

◆ pOriginBox

RectArea Dragengine.Gui.ClosestDirectionFocusFinder.pOriginBox
protected

Referenced by challengeBest(), and processWidget().


The documentation for this class was generated from the following file: