【发布时间】:2014-08-29 15:48:35
【问题描述】:
您好,我正在完成我的游戏,但我想添加一些细节,其中一个正在循环通过我尝试过 SKActions 的颜色循环,效果很好,但它与其他所有内容重叠。
然后我在更新函数中做了这个,但它什么也没做
if BGRed == 1 {RedBoolIs1 = true}
else {RedBoolIs1 = false}
if BGGreen == 1 {GreenBoolIs1 = true}
else {GreenBoolIs1 = false}
if BGBlue == 1 {BlueBoolIs1 = true}
else {BlueBoolIs1 = false}
//red only
if RedBoolIs1 == true && GreenBoolIs1 == false && BlueBoolIs1 == false {
BGGreen = BGGreen + 0.01 }
//red and green
if RedBoolIs1 == true && GreenBoolIs1 == true && BlueBoolIs1 == false {
BGRed = BGRed - 0.01 }
//green only
if RedBoolIs1 == false && GreenBoolIs1 == true && BlueBoolIs1 == false {
BGBlue = BGBlue + 0.01 }
//green and blue
if RedBoolIs1 == false && GreenBoolIs1 == true && BlueBoolIs1 == true {
BGGreen = BGGreen - 0.01 }
//blue only
if RedBoolIs1 == false && GreenBoolIs1 == false && BlueBoolIs1 == true {
BGRed = BGRed + 0.01 }
//blue and red
if RedBoolIs1 == true && GreenBoolIs1 == false && BlueBoolIs1 == true {
BGBlue = BGBlue - 0.01 }
self.backgroundColor = SKColor(red: CGFloat(BGRed), green: CGFloat(BGGreen), blue: CGFloat(BGBlue), alpha: 1)
还有可能使标签在所有颜色上都可读吗?我现在的解决方案是相互放置 2 个标签,第一个是白色的,45 大,上面的一个是黑色,40 大,但看起来并不总是很好
谢谢
【问题讨论】:
标签: colors swift sprite-kit xcode6 spectrum