Where can I learn how to use the GUI?
Discussion in 'Rust Development' started by Sauron 2, Jun 24, 2016.
-
Wulf Community Admin
Existing CUI/GUI plugins, threads in this section, the Oxide repo.
-
I'm sorry.But could not find...
-
Wulf Community Admin
Vanish, InfoPanel, GUI Announcements, GUI Help, GUI Shop, Rules GUI, Kits, Poll System, HitMarker GUI, Compass GUI, DisplayDamage GUI, etc. -
I know about this.Why no examples or some documentation?
-
Wulf Community Admin
Because nobody has contributed examples for it yet. You can see the RustCUI helper on GitHub for documentation if you use it, else Facepunch's CUI repo if you'd prefer to use it directly. Oxide/RustCui.cs at develop · OxideMod/Oxide · GitHub -
Please provide some example.At least to show the square in the gui.This will help everyone who starts to write a plugin and study gui.
-
Wulf Community Admin
Code:string button; void UnstuckButton(BasePlayer player, string text) { var elements = new CuiElementContainer(); button = elements.Add(new CuiButton { Button = { Command = $"unstuck {player.userID}", Color = "0.8 0.8 0.8 0.2" }, RectTransform = { AnchorMin = "0.026 0.037", AnchorMax = "0.075 0.10" }, Text = { Text = (text ?? "U"), FontSize = 20, Align = TextAnchor.MiddleCenter } }, "HUD/Overlay", "unstuck"); CuiHelper.DestroyUi(player, button); CuiHelper.AddUi(player, elements); } -
click function
? -
The example that Wulf showed you runs the command "unstuck {player.userID}" which replaces the player.userID with the player steamid.... that's what it does.
