open-builder
open-builder copied to clipboard
Expand GUiDim
Describe your suggestion
Add mathematical operators (eg. GuiDim.new(10, 0, 0, 0) + GuiDim.new(5, 0, 0, 0)) Add liner interpolation (lerp) (eg. myDim:Lerp(otherDim), 0.1) would allow to smoothly move between two points with a gui. Add tostring support when using tostring(myDim) (also applies to print(myDim) it will print the coordinates. Useful for debugging.
Implementations ideas [optional]
Mathematical operators and tostring can be done through metatables.
- (__add)
- (__sub)
- (__mul) / (__div) % (__mod) ^ (__pow)
tostring/print = (__tostring)
Lerp impl:
float lerp(float a, float b, float t) { return a + (b - a) * t; }
see here for sol metatable documentation.