Functions for easier UI creation
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/UI }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/UI }
#Twitter PeterGGs
#Use these functions to help create a UI system without as much work
#If you want to change the button type just replace it in the MakeButton canvas functions
#Also create buttons of that type
#Credit to Cleverlike Studios for the example of how to place buttons
ui_creator_device := class(creative_device):
var MaybeMyUIPerPlayer:[player]?canvas = map{}
OnBegin<override>()<suspends>:void=
AllPlayers := GetPlayspace().GetPlayers() #gets an array of all players in the game
for (PlayerInGame : AllPlayers): #loops through the array to apply the canvas to everyone
Show1stCanvasPlayer(PlayerInGame) #How to show the first canvas
Show1stCanvasPlayer(Player:player):void= #Shows the first canvas from a player
RemoveCanvasPlayer(Player)
NewCanvas := MakeCanvas1st()
SetCanvas(NewCanvas, Player)
Show1stCanvasTupple(tup:widget_message):void= #Shows the first canvas from a button click
Player := tup.Player #Extracts the player from the widget_message
RemoveCanvasPlayer(Player) #Removes the canvas
NewCanvas := MakeCanvas1st() #Creates the canvas
SetCanvas(NewCanvas, Player) #Applies the canvas to the player
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.