Re: Changing the HUD with Interface Designer. Is it possible
Posted: 28 Jul 2015, 23:33
If you create custom solo script, sure 

https://forum.maniaplanet.com/
WOWdomino54 wrote:Interface Designer is completely other world than ingame HUD.![]()
You need to do a custom mode (can be modified time attack) with your own HUD as an interface layer (best attached to global UI). There is source of scriped version of the default speed and distance meter in UI library used in all scripted TrackMania modes by Nadeo (I cut it to the most important things):Then only need to include Layers2 library in the mode and attach a layer to the global UI:Code: Select all
Text SpeedAndDistance() { return """ <manialink version="1" name="Lib_UI:SpeedAndDistance"> <frame posn="158 -79.5 5" id="Frame_Global"> <format textemboss="1" /> <label posn="-6 0" sizen="30 6" halign="right" valign="bottom" style="TextRaceChrono" textsize="2" text="0" id="Label_Distance" /> <label posn="0 0" sizen="8 6" halign="right" valign="bottom" textsize="1" textemboss="0" text="m" /> <label posn="0 -10" sizen="30 6" halign="right" valign="bottom" style="TextRaceChrono" textsize="8" text="0" id="Label_Speed" /> </frame> <script><!-- #Include "TextLib" as TL #Include "MathLib" as ML main() { declare Frame_Global <=> (Page.GetFirstChild("Frame_Global") as CMlFrame); declare Label_Distance <=> (Page.GetFirstChild("Label_Distance") as CMlLabel); declare Label_Speed <=> (Page.GetFirstChild("Label_Speed") as CMlLabel); while (True) { yield; Frame_Global.Visible = (InputPlayer != Null && InputPlayer.IsSpawned); if (!Frame_Global.Visible) continue; Label_Distance.Value = TL::ToText(ML::FloorInteger(InputPlayer.Distance)); Label_Speed.Value = TL::ToText(ML::FloorInteger(InputPlayer.Speed * 3.6)); } } --></script> </manialink>"""; }
Important: If the mode uses UI library, call the《UI::UnloadModule("SpeedAndDistance");》after attaching the layer or just remove "SpeedAndDistance" from "UI::Load([...]);".Code: Select all
In the top of the script: #Include "Libs/Nadeo/Layers2.Script.txt" as Layers Inside ***StartServer*** label (when using a script running on ModeBase): Layers::Create("Speedometer", SpeedAndDistance()); Layers::Attach("Speedometer"); UIManager.UIAll.OverlayHideSpeedAndDist = True; ///< Hides default speedometer
More! You can also use the UI library to modify visibility and positions of various elements on the screen, for example the Chrono. Just use《UI::SetModulePosition("ModuleName", <0., 0., 0.>);》or《UI::SetModuleVisibility("ModuleName", False);》.
To be honest, I modified the source code of the UI library to make interface for my Turbo title pack with some extra position changes.