CreateButton (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Aboy5643
No edit summary
>Blocco
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 2: Line 2:
|returns    = Button
|returns    = Button
|description = Returns a new [[ToolbarButton]].
|description = Returns a new [[ToolbarButton]].
|object      = Plugin
|object      = Toolbar
|arguments  = [[String]] text, [[String]] caption, [[String]] icon
|arguments  = [[String]] text, [[String]] caption, [[String]] icon
}}</onlyinclude>
}}</onlyinclude>
Line 17: Line 17:
local Button = Toolbar:CreateButton("Print Hello World", "Click this button to print Hello World!", "IconName.png")
local Button = Toolbar:CreateButton("Print Hello World", "Click this button to print Hello World!", "IconName.png")
</pre>
</pre>
This example creates a toolbar named Hello World Plugin Toolbar. The text next to it will say Print Hello World and when you hover over the button it will say "Click this button to print Hello World!" The icon it uses will be in the same folder as the script and is named "IconName.png"
This example creates a toolbar named Hello World Plugin Toolbar. The text next to it will say "Print Hello World" and when you hover over the button it will say "Click this button to print Hello World!" The icon it uses will be in the same folder as the script and is named "IconName.png"
}}
}}


{{Clear floats}}
{{Clear floats}}
[[Category:Methods]]
[[Category:Methods]]

Latest revision as of 19:19, 13 August 2011

CreateButton( String text, String caption, String icon )
Returns Button
Description: Returns a new ToolbarButton.
Member of: Toolbar



Example
local PluginManagerObject = PluginManager()
local Plugin = PluginManagerObject:CreatePlugin()
local Toolbar = Plugin:CreateToolbar("Hello World Plugin Toolbar")
local Button = Toolbar:CreateButton("Print Hello World", "Click this button to print Hello World!", "IconName.png")

This example creates a toolbar named Hello World Plugin Toolbar. The text next to it will say "Print Hello World" and when you hover over the button it will say "Click this button to print Hello World!" The icon it uses will be in the same folder as the script and is named "IconName.png"