Skip to content
Jaliborc edited this page Jul 16, 2012 · 3 revisions

TextureButton is a button class which inherits from ButtonBase and provides buttons with texture or backdrop backgrounds.

Methods

Name Description
SetTexture (file) Sets the texture file path (string) or backdrop (table) to be displayed by the widget.
GetTexture () Returns the texture file path or backdrop displayed by the widget.

Backdrop Tables

This class uses the same structure for backdrop tables as in the standard definition, but with the following extra members:

Name Description
bgColor Optional table with 4 values representing the RGBA code for the color and alpha of the background. All values from 0 to 1.
edgeColor Optional table with 4 values representing the RGBA code for the color and alpha of the border. All values from 0 to 1.

Example

myButton = SushiIconCheck()
myButton:SetIcon('Interface/Addons/MyAddon/NorrisPic.tga')
myButton:SetLabel('Chuck Norris')

myButton:SetCall('OnClick', function(myButton, checked)
	if checked then
		print("You cannot enable Chuck Norris, Chuck Norris never disables.")
	else
		print("You cannot disable Chuck Norris, Chuck Norris disables you.")
	end
end)

Sushi-3.1 🍣

Documentation
Class Reference
Best Practices

Feedback
Post an issue

Clone this wiki locally