var w:Int = Int(self.bounds.size.width / Float(worldSize.width))
var h:Int = Int(self.bounds.size.height / Float(worldSize.height))
Error : 'CGFloat is not convertible to UInt8'
I researched this conver type and i found this one Convert Float to Int in Swift my code like this but not working any idea ?
In beta 4, CGFloat
has become a new type. So you'd do:
var w:Int = Int(self.bounds.size.width / CGFloat(worldSize.width))
var h:Int = Int(self.bounds.size.height / CGFloat(worldSize.height))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With