generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Draw a line on a GUI?

Previous Thread :: Next Thread 
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
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
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
27 Mar 2014 05:15 PM
buuump
Report Abuse
RoflBread is not online. 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
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
27 Mar 2014 05:29 PM
Aww. I figured you could, but I suck at this kind of math ._.
Report Abuse
bombastically is not online. bombastically
Joined: 28 Feb 2014
Total Posts: 128
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
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
27 Mar 2014 06:06 PM
:D Thanks!

Yeah, I'm bad at math ._.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
27 Mar 2014 06:13 PM
Stay in school.
Report Abuse
bombastically is not online. bombastically
Joined: 28 Feb 2014
Total Posts: 128
27 Mar 2014 06:18 PM
np
Report Abuse
SuperiorEternal is not online. SuperiorEternal
Joined: 22 Aug 2009
Total Posts: 2365
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
BlackKnightXx is not online. BlackKnightXx
Joined: 03 Nov 2010
Total Posts: 5526
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
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
27 Mar 2014 08:04 PM
@Goulstem

I'm in 8th grade. They haven't exactly taught us this stuff yet.
Report Abuse
cntkillme is not online. 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
bombastically is not online. bombastically
Joined: 28 Feb 2014
Total Posts: 128
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
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
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
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
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 is not online. 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
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
28 Mar 2014 09:01 AM
Cnt talks pretty good. Have you SEEN the people on this game?
Report Abuse
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
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 is not online. 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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
28 Mar 2014 09:46 AM
^
Report Abuse
maxomega3 is not online. 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
Nikola7007 is not online. Nikola7007
Joined: 20 May 2013
Total Posts: 7998
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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
28 Mar 2014 09:55 AM
Trial and error.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image