UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 14 Jan 2012 04:23 PM |
| Could someone give me an example of using Magnitude on GUI's? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 14 Jan 2012 04:25 PM |
No requests.
Plus that's advanced. As of what swimguy777 accomplished. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 14 Jan 2012 04:27 PM |
| Can you...? It returns the distance between two objects in game, can two GUI's fill those objects? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 14 Jan 2012 04:30 PM |
@neon
Yes it can.
@Ufail
I know it's you :P You're mai little fuzzy cuddle bear :D But this is really advanced... |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 14 Jan 2012 04:32 PM |
| I'll do it by myself then... |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 14 Jan 2012 04:32 PM |
Ok just ask you're brother!!!!!LOL
Dude, just ask him! |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 14 Jan 2012 04:36 PM |
:P
He will see this forum soon enough. |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2012 04:38 PM |
This needs to be run form a localscript as it uses AbsoluteSize.
function MagnitudeGui(Object1, Object2) Pos1 = Object1.Position Pos2 = Object2.Position X = {(Pos1.X.Offset+(Pos1.X.Scale*Object1.Parent.AbsoluteSize.X)), (Pos2.X.Offset+(Pos2.X.Scale*Object1.Parent.AbsoluteSize.X))} Y = {(Pos1.Y.Offset+(Pos1.Y.Scale*Object1.Parent.AbsoluteSize.Y)), (Pos2.Y.Offset+(Pos2.Y.Scale*Object1.Parent.AbsoluteSize.Y))} return math.sqrt((X[2]-X[1])^2+(Y[2]-Y[1])^2)) end |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 14 Jan 2012 04:38 PM |
-_-
GET OFF YOUR SACK AND TELL HIM TO HELP HIM! IF HE DOESN'T HELP BEAT HIM UP UNTIL HE DoES :P |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2012 04:39 PM |
| Oh It returns the distance in Pixels BTW. |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2012 04:40 PM |
| Also I wrote that on the spot so it may have some error. Sorry for multiple posts. |
|
|
| Report Abuse |
|
|
Smirky
|
  |
| Joined: 05 Apr 2008 |
| Total Posts: 3598 |
|
|
| 14 Jan 2012 04:47 PM |
| I don't believe Gui objects have magnitude by default. I'm fairly certain you have to make customize it. |
|
|
| Report Abuse |
|
|
Smirky
|
  |
| Joined: 05 Apr 2008 |
| Total Posts: 3598 |
|
|
| 14 Jan 2012 04:48 PM |
| Well, I guess I was a little bit late on that. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
|
| 14 Jan 2012 05:42 PM |
just to add to this... there a thread i have tracked that relates to this. it might be useful http://www.roblox.com/Forum/ShowPost.aspx?PostID=54712496
~I've been to nil and back. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 14 Jan 2012 05:50 PM |
@MrGame
When do you learn math.sqrt? I mean in school? |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2012 05:53 PM |
... not sure where that question came from, but uh.... hmmm... quite a while ago. elementary school maybe? i'm in 10th grade now.
~I've been to nil and back. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 14 Jan 2012 05:55 PM |
-_-
Explain what it does? And in what, algebra? |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2012 05:58 PM |
well, math.sqrt just finds the square root of a number. the square root is the number of.... uhmmm... the number of times a number of times a number goes into that number of numberness and numbers and stuff :D? its been to long, the calculator has ruined me :P
~I've been to nil and back. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
|
| 14 Jan 2012 08:27 PM |
Don't over-complicate things:
local Mag = (Vector2.new(Obj1X, 0) - Vector2.new(Obj2X, 0).magnitude |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2012 08:40 PM |
-.-
local Mag = (Vector2.new(Obj1X, 0) - Vector2.new(Obj2X, 0).magnitude) |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2012 08:45 PM |
^
~I've been to nil and back. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|