UI Creation Lua?

Discussion in 'Rust Development' started by Norn, Aug 25, 2015.

  1. Has anyone any example code for creating ui elements in Lua? Can't seem to find any documentation
     
  2. tried it some time ago but failed. What I tried for my admin tickets:
    Code:
     json ="[\"\"name\"\": \"\"TicketGUI\"\",\"\"parent\"\": \"\"Overlay\"\",\"\"components\"\":[{\"\"type\"\":\"\"UnityEngine.UI.Text\"\",\"\"text\"\":\"\"{text}\"\",\"\"fontSize\"\":20,\"\"align\"\": \"\"MiddleCenter\"\",},{\"\"type\"\":\"\"RectTransform\"\",\"\"anchormin\"\": \"\"0 0.20\"\",\"\"anchormax\"\": \"\"1 0.9\"\"}]}]"
        text ="There currently are <color=aqua>"..#TicketsData.Tickets .."</color> active tickets!"
       local players = global.BasePlayer.activePlayerList:GetEnumerator()
       while players:MoveNext()do
           local currId = rust.UserIDFromPlayer(players.Current)
           if permission.UserHasPermission(currId,"isTicketsAdmin")then
                CommunityEntity.ServerInstance:ClientRPCEx( Network:SendInfo(){ connection = players.Current.net.connection },nil,"AddUI",string.gsub(json,"{text}", text));
           end
       end
    had no error but nothing happening
     
  3. So basically c# or nothing in this case... i guess?
     
  4. idk mate It was just a try and I did not get it working.