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 » Scripters
Home Search
 

Re: Speedometer? (Advanced GUI discussion)

Previous Thread :: Next Thread 
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Jul 2012 08:36 PM
Hey guys. I'm unbanned now.

Anyways, I was looking at some realistic car models and noticed that plenty of them had a speed label but not a speedometer.

What I want to know is, is this possible? To make a needle point left or right but keep its position (2D).

If so, how do you accomplish this? I want to move away from images and use something more dynamic such as a frame with a red background color.

I imagine this will be easier with Sorcus's GUI rotation, but until then, is there a workaround?

- Techboy6601, eater of donuts
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
24 Jul 2012 08:42 PM
[ Content Deleted ]
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
24 Jul 2012 08:43 PM
[ Content Deleted ]
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Jul 2012 08:58 PM
How do you make lines? Is it some specific RbxGui feature?
Report Abuse
um3k is not online. um3k
Joined: 28 Feb 2008
Total Posts: 189
24 Jul 2012 09:08 PM
Hint: A line is a narrow rectangle.

Hint 2: Frames are rectangles.
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Jul 2012 09:10 PM
Hint 3: I'm an idiot.
Report Abuse
um3k is not online. um3k
Joined: 28 Feb 2008
Total Posts: 189
24 Jul 2012 09:19 PM
Oh, wait, you need it to pseudo-rotate. You'll need to make it out of multiple square frames and position them at intervals along the line defined by Oysi's script.

You can create a bunch of frames with a for loop, and store them in a table. Then iterate through them on each update, setting the position to an appropriate Lerp (I presume this would be faster than multiple trigonometric calculations) between the midpoint and Oysi's script. It'll be a bit jagged, but it should work.
Report Abuse
ColorlessBody is not online. ColorlessBody
Joined: 21 Jun 2012
Total Posts: 193
24 Jul 2012 09:28 PM
I suggest you just use a label to tell the speed for now. When they'll release GUI rotation, then you'll update it to use GUI rotation.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
25 Jul 2012 12:00 AM
"local speed = 50 -- speed of your vehicle
local top = 200 -- speed when the needle points directly to the right

local t = -math.pi + speed/top*math.pi

local x = math.cos(t)/2
local y = math.sin(t)/2

Now update/create a line from (0.5, 0.5) to (x, y) in scale coordinates.


I think that should work. =)"


umg thats the first oysi magic that i actually understand
Report Abuse
Combrad is not online. Combrad
Joined: 18 Jul 2009
Total Posts: 11025
25 Jul 2012 02:10 AM
I'd create all the frames first.
Then calculate there positions, rather than just reinstancing them each time.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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