Releases: MasterBel2/Master-GUI-Framework
Version 43: Limit unnecessary layout / position / draw passes
Agressive changes have been made to how updates are made to reduce the necessary fequency of calculations:
Rasterizer
has been merged intoDrawingGroup
.DrawingGroup
now uses draw lists by default. See documentation for how to disable this, for cases where it harms performance.Position
can now be expected to be called more than once for someLayout
calls, where sizing hasn't changed but positioning has (e.g. )- Even if rasterization isn't involved,
Draw
can be called more than once perPosition
/Layout
call. - To specifically request an update to any of
Layout
/Position
/Draw
, the corresponding property may be set on the relevantDrawingGroup
. SeeDrawer
andComponent
for more detail and example implementations.
To facilitate this:
- Most components that allow specifying a child no longer make their child editable; instead, when you wish to mutate a child view hierarchy, set the parent's initial child to
Box
, which allows its child to be changed (viaBox:SetChild(newChild)
). Rect
,MarginAroundRect
, andCell
no longer draw decorations. UseBackground
instead to attach a background.
(Note thatBackground
doesn't have the rasterizing optimisation thatMarginAroundRect
did; instead, use nestedDrawingGroup
s to separate the re-drawing profile of different parts of the interface hierarchy.)HorizontalStack
,VerticalStack
, andStackInPlace
no longer make their members public; instead, they must be set/get through methods that copy to/from the internal member array.- Other mutable properties for other component types must be changed through methods, similar to above.
- Some properties are simply no longer mutable.
Dimension
now has a base constructor that registers for updates with the drawing group; the previous functionality of theDimension
function has moved toAutoScalingDimension
.OffsettedViewport
is now an overriding extension ofDrawingGroup
.
Changes to Menu
:
MenuAnchor
now providesmenuAnchor:GetMenu()
to allow accessing its menu.Menu
providesmenu:IsMouseOver()
which returns whether the user's cursor is over the menu or one of its submenus.Menu
's submenu menu items are now aMenuAnchor
at the top level, rather than aMarginAroundRect
at the top level. (This probably shouldn't be of practical concern to users of the framework.)
Misc other changes:
- Remove elements with incomplete
PrimaryFrame
geometry, to prevent log spam and allow interaction - Various bugfixes
- TextEntry & Button store their colours in constants, providing potential to override & set custom styles
PrimaryFrame
no longer attempts recovery ifLayout
hasn't been called yetElement
s are removed if noPrimaryFrame
is present in the view hierarchyHorizontalScrollContainer
andVerticalScrollContainer
now use the customisableframework.dimension.scrollMultiplier
to configure their scroll speed. This should provide the same scrolling experience on a 1080p display, and scale better to larger resolutions.
Version 42.1 - debugDescriptionString: fix infinite recursion avoidance, add documentation
v42.1 debugDescriptionString: fix infinite recursion avoidance, add documen…
Version 42: Misc - kill funcs.lua, separate out constants, change WG access
Extensions are now declared in MasterFramework $VERSION/Utils
, and pre-loaded before the rest of the framework. These are provided the same global environment as the rest of the framework. string
extensions now all have _MasterFramework
at the end of their name, while the table
extension overrides the Include.table
table for the framework, and provides access to the customised version as framework.table
. The definition of Include.clear
has been moved to Utils/table.lua
, and table.joinStrings()
has been removed, since it was a slower reimplementation of table.concat()
Constants have been moved out of gui_master_framework.lua
into separate files in the Constants/
directory. Subfiles are not automatically loaded to allow for dependencies, other than the entry point Constants/constants.lua
.
The main framework files which would have been loaded in previous versions are now contained in the Framework/
directory.
The new major directories are loaded in this order: Utils/
, Framework/
, then Constants/
.
Framework access is no longer provided as WG.MasterFramework[compatabilityVersion]
, instead as WG["MasterFramework " .. compatabilityVersion]
. Removing the intermediate table technically simplifies this?