GMUserView:
Filter:
GraphicalModule/Classes (extension) | GUI > Graphical Module

GMUserView
ExtensionExtension

An abstract class used for creating graphical interfaces

Description

GMUserView is an abstract class used to centralize some methods that (almost) every Class from the Graphical Module are using.

It inherits from the UserView class.

Its main usage is to provide common functions to it's children, notably the .drawFrame method that is used to draw the background of the widgets, and allow communication between the .drawFunc and the GMStyle associated to the widget.

It can be used to draw an empty frame, but it is designed as if each of it's method was internal.

Class Methods

.new

Creates a new instance of GMUserView.

This will be an empty view, and as such doesn't really makes sense.

Returns:

a GMUserView instance.

Instance Methods

.style

Sets or gets the GMStyle associated to the widget.

.displayBorder

Sets or gets wether the border of the widget should be apparent.

.displayBackground

Sets or gets wether the background of the widget should be apparent.

.displayFrame

Sets wether both the background and the border of the widget should be apparent.

Internal Methods

.init

Associate the default GMStyle to this instance. Used at initialisation.

.drawBorder

The function that draws every border of the widget.

.drawBackground

The function that draws the background of the widget. The background color must be passed explicitely as argument.

.drawFrame

The function that draws the background of the widget, then every border. The background color must be passed explicitely as argument.

.interactionRect

Returns the surface of the widget that can be interacted with as a Rect, i.e. the size of the widget minus the borders sizes.

Returns:

a Rect

.stringCenteredIn

A function that allows to display text in a rectangular portion of the widget.

Internal Methods : style getters

The following methods are getters that allow communication with the associated GMStyle in the context of the drawFunc.

.mainColor

.secondColor

.backColor

.backgroundColor

.disabledColor

.borderSize

.secondBorderSize

.thirdBorderSize

.borderColor

.secondBorderColor

.thirdBorderColor

.font

.fontColor

.fontColorDisabled

.selectedColor

.outlineSize

.outlineColor

.beatColor

.helpersColor

.valueFontColor

.highlightColor