|
| 27 Mar 2014 04:39 PM |
| Is there any method or library to draw a line on a GUI Frame? Just a simple line from one point to the other, probably rotated. Is there any way to do this without doing all the math? |
|
|
| Report Abuse |
|
|
| |
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 27 Mar 2014 05:18 PM |
| Nope. But as you say, you could make one with some simple math. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2014 05:29 PM |
| Aww. I figured you could, but I suck at this kind of math ._. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2014 05:45 PM |
function drawline(vec1, vec2) -- needs two vector2's local dir = (vec2 - vec1).unit local mag = (vec2 - vec1).magnitude for i = 1, mag, 2 do local l = Instance.new("Frame", script.Parent) l.Position = UDim2.new(0, dir.X*i, 0,dir.Y*i) l.Size = UDim2.new(0,1,0,1) end end
drawline(Vector2.new(10, 10), Vector2.new(20, 500)) |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2014 06:06 PM |
:D Thanks!
Yeah, I'm bad at math ._. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
| |
|
|
| 27 Mar 2014 06:19 PM |
| Or you could make it, so when ever you hold down your mouse on that gui, it will constantly make little square guis so you can draw with it. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2014 06:25 PM |
get some kind of GUI plugin that allows you to draw the GUIs and drag the frames to a place and stuff
don't genius live in a lamp? |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2014 08:04 PM |
@Goulstem
I'm in 8th grade. They haven't exactly taught us this stuff yet. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Mar 2014 08:08 PM |
| Go learn yourself, screw school and learn what you want online and let school teach you the stuff you are never going to use |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2014 01:18 AM |
| im in sixth grade, i know how to do it because i got bored and wanted to figure out how to make lines |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2014 08:35 AM |
| Eh, I'm not really that interested in math anyways. Well, thanks for the help, bombastically. This is for a graphing calculator script (graphing = math... irony) so if it works, I'll put you in the credits :) |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2014 08:38 AM |
| Ok, now I will try to figure out how that function works. I'll probably fail at scripting if I can't do this stuff. |
|
|
| Report Abuse |
|
|
Clickest
|
  |
| Joined: 06 Aug 2013 |
| Total Posts: 6504 |
|
|
| 28 Mar 2014 08:46 AM |
@Cnt, that explains why you talk like a five year old :P
ℭ - Frame |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2014 09:01 AM |
| Cnt talks pretty good. Have you SEEN the people on this game? |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2014 09:10 AM |
| The most I can figure out it that it draws a Frame on each point of the line. But how does it get each point ._. Is there a website where I can learn this stuff? |
|
|
| Report Abuse |
|
|
Looah
|
  |
| Joined: 22 Feb 2013 |
| Total Posts: 922 |
|
|
| 28 Mar 2014 09:43 AM |
| shouldn't one just create a frame in the center of the two points, size it half the distance between the points and then rotate it with something I forgot? |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 28 Mar 2014 09:49 AM |
Wow, Nikolai. Haven't seen you in forever 0.o
Also, you learn about vectors and magnitude and all that good stuff in Geometry. |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2014 09:51 AM |
I'm in Geometery. We're learning about this stuff but I have no idea how to rotate a Frame to create a line
Well I guess you could do something with triangles.
Ok, how about, I'm bad at APPLYING math |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|