Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand GUiDim #158

Open
Zwolf8 opened this issue Feb 19, 2020 · 0 comments
Open

Expand GUiDim #158

Zwolf8 opened this issue Feb 19, 2020 · 0 comments
Labels
Feature Suggestions or PRs that add new features GUI Stuff to do with the GUI systems Long term Feature requests that a more of a long term thing rather than a do now thing

Comments

@Zwolf8
Copy link

Zwolf8 commented Feb 19, 2020

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.

@Zwolf8 Zwolf8 added the Feature Suggestions or PRs that add new features label Feb 19, 2020
@Hopson97 Hopson97 added the Long term Feature requests that a more of a long term thing rather than a do now thing label Feb 19, 2020
@Hopson97 Hopson97 added the GUI Stuff to do with the GUI systems label Mar 9, 2020
@Hopson97 Hopson97 added this to To do in Open Builder Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Suggestions or PRs that add new features GUI Stuff to do with the GUI systems Long term Feature requests that a more of a long term thing rather than a do now thing
Projects
Open Builder
  
To do
Development

No branches or pull requests

2 participants