Zeta 11 Posted August 30, 2014 Share Posted August 30, 2014 How can i set color in this text? self.skill1text1 = ui.TextLine() self.skill1text1.SetParent(self.thin) self.skill1text1.SetDefaultFontName() self.skill1text1.SetPosition(15, 10) self.skill1text1.SetText("123456)") self.skill1text1.SetOutline() self.skill1text1.Show() Link to comment Share on other sites More sharing options...
Risan 115 Posted September 1, 2014 Share Posted September 1, 2014 Use grp ... Example: import grp self.TraceToolTip.AppendTextLine("Startgebot:" + str(NewStartGebot),grp.GenerateColor( (255.00 / 255) , (200.00 / 255), (72.00 / 255), 1.0)) Is Gold Text ^^ Link to comment Share on other sites More sharing options...
Zeta 11 Posted September 1, 2014 Author Share Posted September 1, 2014 self.skill1text1 = ui.TextLine() self.skill1text1.SetParent(self.thin) self.skill1text1.SetDefaultFontName() self.skill1text1.SetPosition(15, 10) self.skill1text1.AppendTextLine("Startgebot:" + str(NewStartGebot),grp.GenerateColor( (255.00 / 255) , (200.00 / 255), (72.00 / 255), 1.0)) self.skill1text1.SetOutline() self.skill1text1.Show() Like this? it didn't work 'TextLine' object has no attribute 'AppendTextLine' Link to comment Share on other sites More sharing options...
Honorable Member Solution xP3NG3Rx 19743 Posted September 1, 2014 Honorable Member Solution Share Posted September 1, 2014 Jesus Christ. AppendTextLine is a method of uiTooltip.Tooltip() class object. You can use two methods of TextLine to make a colored line: class TextLine(Window): def SetFontColor(self, red, green, blue): wndMgr.SetFontColor(self.hWnd, red, green, blue) def SetPackedFontColor(self, color): wndMgr.SetFontColor(self.hWnd, color) The packed color is that what the grp module can generate to you with the GenerateColor method. For example(lightgreen): packed_color = grp.GenerateColor(105./255, 1., 75./255, 1.) Usage: text = ui.TextLine() #text.SetParent(self) text.SetDefaultFontName() text.SetPosition(16, 77) text.SetPackedFontColor(grp.GenerateColor(105./255, 1., 75./255, 1.)) #text.SetFontColor(105/255., 255./255, 75./255) text.SetText("This is a green message") text.Show() 1 Link to comment Share on other sites More sharing options...
Zeta 11 Posted September 1, 2014 Author Share Posted September 1, 2014 Jesus Christ. AppendTextLine is a method of uiTooltip.Tooltip() class object. You can use two methods of TextLine to make a colored line: class TextLine(Window): def SetFontColor(self, red, green, blue): wndMgr.SetFontColor(self.hWnd, red, green, blue) def SetPackedFontColor(self, color): wndMgr.SetFontColor(self.hWnd, color) The packed color is that what the grp module can generate to you with the GenerateColor method. For example(lightgreen): packed_color = grp.GenerateColor(105./255, 1., 75./255, 1.) Usage: text = ui.TextLine() #text.SetParent(self) text.SetDefaultFontName() text.SetPosition(16, 77) text.SetPackedFontColor(grp.GenerateColor(105./255, 1., 75./255, 1.)) #text.SetFontColor(105/255., 255./255, 75./255) text.SetText("This is a green message") text.Show() Thanks!!! 1 Link to comment Share on other sites More sharing options...
Risan 115 Posted September 1, 2014 Share Posted September 1, 2014 OH JESUS ;D Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now