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: Detecting when a GUI overlaps another GUI

Previous Thread :: Next Thread 
Usering is online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
05 Feb 2013 12:15 AM
I have been experimenting and I can't find an algorithm that I can think of that can detect when one TextLabel overlays another. The reason I'm asking is because I'm making a game much similar to the 2D game, Space Invaders. I have already made the spaceship and pellets working but I need to know how to tell when one TextLabel overlays so it mocks when the bullet hits the little orb to give you one point.

If you can help, please reply; if not go away.

[ Content Trolled by Sorcus ]
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
05 Feb 2013 12:57 AM
You need to make your own using *dun dun dun* MATH! :O
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
05 Feb 2013 01:04 AM
ZIndex.

--
i liek pineapples.
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
05 Feb 2013 01:07 AM
I know a way. But it's kinda hard to explain.

--
i liek pineapples.
Report Abuse
Kirbykid02 is not online. Kirbykid02
Joined: 18 May 2009
Total Posts: 2671
05 Feb 2013 02:44 AM
Main way is checking by size and position whether it overlaps.
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
05 Feb 2013 04:00 AM
You can use math to figure out the area taken up by the gui.

Yregion = Gui.Position.Y.Scale + Gui.Size.Y.Scale
Xregion = Gui.Position.X.Scale + Gui.Size.Z.Scale

Then check is one is in another's region.
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
05 Feb 2013 09:05 AM
http://wiki.roblox.com/index.php/Collision_detection_for_GUI%27s
Report Abuse
Usering is online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
05 Feb 2013 09:27 AM
@Free, thanks I don't know why I didn't check the wiki first; as I am a wiki writer lol

[ Content Trolled by Sorcus ]
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