API:CreateUIComponent

__NOTOC__
Allows you to dynamically create a UI Component (aka Widget)
frameObject = CreateUIComponent("widgetName","frameName", "parentFrameName", "templateFrameName", layer)
== Parameters ==
:;widgetName
::String - the name of a widget element like "Frame", Button", etc.
:;frameName
::String - the name you want to give to the created frame (can be "" if you don't want a global frame variable created)
:;parentFrameName
::String - the name of a parent frame (use "UIParent" if you're not sure)
:;templateFrameName (optional)
::String - the name of a virtual template frame, which your newly created frame will inherit from
:;layer (optional)
::Integer - the layer number of the component, defaults to -1
== Returns ==
:;frameObject
::Table - a table representing the frame.
== Example ==
Working code for this can be found in uipaneltemplates.lua.
== This code has to be written in a file.. ==
local Create = CreateUIComponent("CheckButton", "MyCheckButton", "UIParent", "UIPanelCheckButtonTemplate") -- Creates a CheckButton
Create:ClearAllAnchors() -- Clear The Anchores of the new created CheckButton ( you need to do this if you want to give it a position )
Create:SetAnchor("CENTER", "CENTER", "UIParent"); -- Put it in center of ur screen
Category:Functions