local Widget = require "widgets/widget"
local Button = require "widgets/button"
local Image = require "widgets/image"
local Text = require "widgets/text"

local Zg_SkillButton = Class(Button, function(self, inst, atlas, normal_tex, focus_tex, x,y,z, str)
	
	Button._ctor(self, "Zg_SkillButton")
	
	--定义按钮
	
	--增加贴图
    --self:SetTextures(atlas, normal_tex, focus_tex, normal_tex) 
	--SetTextures(atlas, normal, focus, disabled, down, selected, image_scale, image_offset)
	
	self.image = self:AddChild(Image())
    self.image:SetTexture(atlas, normal_tex, focus_tex) 
	
	--技能按钮的位置
    self:SetPosition(x, y, z)
	
	--定义文字
	self.text0 = self:AddChild(Text(NUMBERFONT, 40))
	self.text0:SetVAlign(ANCHOR_MIDDLE)
    self.text0:SetColour({0,1,0,1})
	self.text0:SetString(str)
	
	--self:SetScale(.75, .75, .75)
end)

function Zg_SkillButton:Zg_SetTint(a,b,c,d)
	self.image:SetTint(a,b,c,d)
end

function Zg_SkillButton:Zg_SetColour(a,b,c,d)
	self.text0:SetColour({a,b,c,d})
end

function Zg_SkillButton:Zg_SetString(str)
	self.text0:SetString(str)
end

return Zg_SkillButton





