according bmglyph library, can change label color doing:
self.label.color = uicolor(...)
the font created using bmglyph has 1px black stroke white background.
using skaction.colorizewithcolor() isn't option since doesn't work. tested it. not normal skspritenode.
i wanted change label color depending on user's score. code:
var color = uicolor.whitecolor() if self.score > 10 { color = getuicolor(153, g: 185, b: 152, a: 1) }else if self.score > 40 { color = getuicolor(156, g: 151, b: 217, a: 1) }else if self.score > 60 { color = getuicolor(127, g: 191, b: 217, a: 1) }else if self.score > 80 { color = getuicolor(232, g: 121, b: 198, a: 1) }else if self.score > 100 { color = getuicolor(232, g: 74, b: 95, a: 1) }else if self.score > 120 { color = getuicolor(125, g: 227, b: 179, a: 1) }else if self.score > 150 { color = getuicolor(152, g: 226, b: 90, a: 1) }else if self.score > 200 { let redrand = cgfloat(arc4random_uniform(255)) let greenrand = cgfloat(arc4random_uniform(255)) let bluerand = cgfloat(arc4random_uniform(255)) color = getuicolor(redrand, g: greenrand, b: bluerand, a: 1) } self.scorelabel.color = color
any solution this? keep 1px border font.
thanks.
there bug sprite kit change colorblendfactor
when things happen (like having default alpha of 0 change 0 reason) make sure explicitly set value whenever want make color alterations.
Comments
Post a Comment