Yue Posted May 29, 2019 Share Posted May 29, 2019 myPanel:SetString("radius",9") -- Not Workd. myButton:SetString("radius,9) -- Yes Work. The only way it works is to modify the values directly in the lua panel file. function Script:Draw(x,y,width,height) local gui = self.widget:GetGUI() local pos = self.widget:GetPosition(true) local sz = self.widget:GetSize(true) local scale = self.widget:GetGUI():GetScale() if self.widget:GetParent()==nil then gui:SetColor(0,0,0,0) gui:Clear() end gui:SetColor(self.backgroundcolor.r,self.backgroundcolor.g,self.backgroundcolor.b,self.backgroundcolor.a) --gui:SetColor(self.color.background.r,self.color.background.g,self.color.background.b,self.color.background.a) gui:DrawRect(pos.x,pos.y,sz.width,sz.height,0,4.5) --self.radius <<<<<<<<<<<<<<<<<<<<<<<< --Draw image if present local image = self.widget:GetImage() if image~=nil then local imgsz = image:GetSize() imgsz.x = imgsz.x * scale imgsz.y = imgsz.y * scale gui:SetColor(self.color.foreground.r,self.color.foreground.g,self.color.foreground.b,self.color.foreground.a) --gui:DrawImage(image,pos.x+(sz.x-imgsz.x)/2,pos.y+(sz.y-imgsz.y)/2,imgsz.x,imgsz.y) gui:DrawImage(image,pos.x,pos.y,sz.x,sz.y) end --Draw border --if self.border then gui:SetColor(self.color.border.r,self.color.border.g,self.color.border.b,self.color.border.a) --gui:SetColor(0,1,0,1) gui:DrawRect(pos.x,pos.y,sz.width,sz.height,1,4.5) --self.radius <<<<<<<<<<<<<<<<<<<<<<< --end --gui:SetColor(1,0,0) --gui:DrawRect(pos.x,pos.y,sz.width,sz.height,1) --gui:DrawRect(pos.x+self.indent/2*scale,pos.y+self.indent/2*scale,sz.width-self.indent*scale,sz.height-self.indent*scale,1) --gui:DrawRect(pos.x,pos.y,sz.width,sz.height,1) end Quote Link to comment Share on other sites More sharing options...
Rick Posted May 29, 2019 Share Posted May 29, 2019 myPanel:SetBool("radius",9") -- Not Workd. myButton:SetBool("radus,9) -- Yes Work. Look at the syntax you have there. You'll always need matching double quotes. Your first one you have a double quote at the end of the 9 but no matching one for that. Your second one you only have 1 double quote. 1 Quote Link to comment Share on other sites More sharing options...
Yue Posted May 29, 2019 Author Share Posted May 29, 2019 Okay, if I misspelled here, but it still doesn't work. myPanel:SetBool("radius",9") -- Not Workd. myButton:SetBool("radius,9) -- Yes Work. myPanel:SetFloat("radius",9") -- Not Workd. myButton:SetFloat("radius,9) -- Yes Work. Quote Link to comment Share on other sites More sharing options...
Rick Posted May 29, 2019 Share Posted May 29, 2019 What does SetBool() do? It seems odd to me that you'd pass multiple 2 values, a string and a number to something called SetBool(). SetBool(string name, boolean value) Your second value should be a true/false not a number. Maybe you're looking for SetInt() (if that exists) [EDIT] Looks like there is a SetFloat() that you may be looking for. 1 Quote Link to comment Share on other sites More sharing options...
Yue Posted May 29, 2019 Author Share Posted May 29, 2019 This is crazy, when I try to pass to English what I want to express in Spanish. If evidently it is SetFloat. With SetFloat, I can take variables from widgets, and change certain values before variables. But it certainly doesn't work. on Panel. Quote Link to comment Share on other sites More sharing options...
GorzenDev Posted May 29, 2019 Share Posted May 29, 2019 they all definitly work no doubt about it. are you certain that the variable you try to read/write actually exists in the widget script?? i assume you are looking for. widget:SetFloat("radius", 2); widget:GetFloat("radius"); REMEMBER !!! call widget:Redraw() when you change a variable's value. often you would think "hey this does not work" while it usually does work but is not updated yet ? Quote Link to comment Share on other sites More sharing options...
Yue Posted May 29, 2019 Author Share Posted May 29, 2019 The variable es radius. ( Script.radius ) T The edges of the panel are not rounded. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.