Well, the GUI editor can finally rotate gfx with custom pivot points allowing some pretty cool things like this:
oh yes! we have wanted to make a proper speedo for ages but have finally done it in Gen2. The Visual GUI Editor made it a breeze compared to coding it and the whole demo was done in less than 30 mins including the script inclusion on the vehicle:
Note: We know the needle is not completely accurate, but it was close enough for a video
Here is all the script needed:
- Code: Select all
speedo_GuiID = -1;
speedo_minangle = -136;
speedo_maxangle = 136;
function loadSpeedoGUI( )
gui.workSpace("Game Mechanics/Speedometer/");
speedo_GuiID = gui.load("Speedometer_RotateTest.rml", 0, 0);
gui.setAttribute(speedo_GuiID,"Speedo_Needle", "rotate", speedo_minangle);
end
function updateSpeedoGUI( currentmph )
gui.workSpace("Game Mechanics/Speedometer/");
speedo_GuiID = gui.load("Speedometer_RotateTest.rml", 0, 0);
gui.setAttribute(speedo_GuiID,"Speedo_Needle", "rotate", speedo_minangle + currentmph);
absMath = math.floor(currentmph)
gui.setText(speedo_GuiID,"Speedo_Speed", absMath.." mph");
end
Nice and simple Pretty excited about this one!
Note: The speedo images are placeholders only for testing, but we will be making some skyline gfx unless one of our community want to make them instead