Zackreaver Posted April 9, 2015 Share Posted April 9, 2015 (edited) I'm testing out a stamina system I made for one of my characters.The stamina stat works so now I want to try and create a visualization for it. WIDGETS... I have no idea where I should start.Trying to find the beginning for figuring these things out so I can understand how to create one in the future. Tried searching for a widget guide but can't really find what I'm looking for. From their outward appearance they look complicated, but I bet they might be easier than I'm making them out to be. At any rate, where should I start for figuring these things out? Did anyone make a guide for widgets that I just seemed to overlook? Edit: Looking at the mod Always-On Status, I think I got them figured out, at least some of the basic parts of it. I managed to get what I want to show up. Edit 2: This is what I managed to come up with out of looking at Always-On Statuslocal function StatusPostConstruct(self) if true then self.staminabar = self:AddChild(Badge("stamina", self.owner)) self.staminabar.bg = self:AddChild(Image("images/status_bgs.xml", "status_bgs.tex")) self.staminabar.num:SetFont(GLOBAL.NUMBERFONT) self.staminabar.num:SetSize(28) self.staminabar.bg:SetScale(.4,.43,0) self.staminabar.bg:SetPosition(-80.5, -40.5, 0) self.staminabar.num:SetPosition(3.5, -40.5, 0) self.staminabar.num:SetScale(1,.78,1) self.staminabar.num:MoveToFront() self.staminabar.num:Show() self.staminabar.bg:MoveToBack() self.inst:ListenForEvent("panicstaminadelta", function(inst) local val = self.owner.PanicStamina or 0 self.staminabar.num:SetString(tostring(math.ceil(val)).."") end, self.owner) self.staminabar:SetPosition(-80.5,0,0) self.restmeter = self:AddChild(Badge("restmeter", self.owner)) self.restmeter.bg = self:AddChild(Image("images/status_bgs.xml", "status_bgs.tex")) self.restmeter.num:SetFont(GLOBAL.NUMBERFONT) self.restmeter.num:SetSize(28) self.restmeter.bg:SetScale(.4,.43,0) self.restmeter.bg:SetPosition(-80.5,-70,0) self.restmeter.num:SetPosition(3.5, -40.5, 0) self.restmeter.num:SetScale(1,.78,1) self.restmeter.num:MoveToFront() self.restmeter.num:Show() self.restmeter.bg:MoveToBack() self.inst:ListenForEvent("restmeterdelta", function(inst) local val = self.owner.RestMeter or 0 self.restmeter.num:SetString(tostring(math.ceil(val)).."") end, self.owner) self.restmeter:SetPosition(-80.5,-30,0) self.restmeter:Show() endendAddClassPostConstruct("widgets/statusdisplays", StatusPostConstruct) The if true then is just there for me to replace with a config boolean to replace it later. But I think I figured it out generally well. Edit 3: Okay I figured out basic widgets (sorta) though I am quite curious as to how the badges handle their meter graphic going up and down. A new question, how would I make a widget that act's as a bar that fills up or empties depending on the variable it's referencing? I'm going to dig at the healthbadge and badges a bit for this info, but if anyone who's worked with them knows what does what, some guidance would be helpful. Edited April 10, 2015 by Zackreaver Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now