Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Displaying a a function f(x) as a GUI, Complex Scripting Help?

Asked by 4 years ago

I'm developing a firefighter roblox game that contains more than fighting fires but allows players to assist in real world medical assistance and medical emergencies.

I'm building a GUI to view the heart rate of a patient. I'm smart in calculus and beyond and I know how to manipulate a function to change the heart rate for different patient conditions.

The base function follows:

https://www.desmos.com/calculator/luuqo8qa4b

As you can see as 'b' increases the heartbeat moves through the red region. How do I make the red region a GUI. And display this graph as a GUI to display a beating heartbeat? The GUI has no scripts yet so anything that works is great, no need to worry about server events and such in the GUI.

Thank You, Jonathanmm305

1 answer

Log in to vote
0
Answered by 4 years ago

This isn't a request site, but if you're just wanting an overview, these are some things you can do (look up anything I mention on the API site, ex https://developer.roblox.com/en-us/api-reference/class/ScreenGui - just search what you want to know about):

  • Use a 2D GUI (probably shown with SurfaceGUI), perhaps with a bunch of frames that work together to draw the curve (each line might only be 3-10 pixels wide - it won't be a perfect curve, but it'll communicate the idea well enough)
  • Use a ViewportFrame, either with bricks that act as lines/curves or investigate using beams (https://developer.roblox.com/en-us/api-reference/class/Beam)

You will need to update the frames/bricks/beams every frame, ex by listening to RunService's Heartbeat event.

Ad

Answer this question