ToGraphicalUiElement
Introduction
Code Example - ToGraphicalUiElement on Screen
// assuming gumProject is a valid Gum project:
var screen = gumProject.Screens.Find(item => item.Name == "MainMenu");
// Calling ToGraphicalUiElement creates the visuals for the screen
var graphicalUiElement = screen.ToGraphicalUiElement();
graphicalUiElement.AddToRoot();Code Example - ToGraphicalUiElement on Component
// assuming gumProject is a valid Gum project
// and that ScrollViewerInstance is also a valid ScrollViewer:
var component = gumProject.Components.Find(item => item.Name == "CustomButton");
// Calling ToGraphicalUiElement creates an instance of the compnent. This can be
// called multiple times:
for(int i = 0; i < 10; i++)
{
var customButtonInstance = component.ToGraphicalUiElement();
ScrollViewerInstance.AddChild(customButtonInstance);
}Last updated
Was this helpful?

