ios - SKLabelNode Creating Black Rectangle -
i saw this question, did not have definite solution issue, nor exact same. trying add sklabelnode text. have never had issues reason happening: here code using generate node:
var announcelabel = sklabelnode(fontnamed: "baskerville") announcelabel.text = "error loading announcement" announcelabel.fontcolor = uicolor.blackcolor() announcelabel.fontsize = 200 announcelabel.setscale(twitterbutton.frame.height / announcelabel.frame.height) announcelabel.position = cgpoint(x: self.frame.midx, y: self.frame.midy) self.addchild(announcelabel)
i testing on iphone 6, , have never had happen while creating label node. have attempted different fonts, positions, , scales no effect. appreciated! thanks!
just tested more , found answer. font size big , guess caused bug spritekit. changed font size 50 , worked fine (i have used font size 200 on other label nodes , never had issue):
var announcelabel = sklabelnode(fontnamed: "baskerville") announcelabel.text = "error loading announcement" announcelabel.fontcolor = uicolor.blackcolor() announcelabel.fontsize = 50 announcelabel.setscale(twitterbutton.frame.height / announcelabel.frame.height) announcelabel.position = cgpoint(x: self.frame.midx, y: self.frame.midy) self.addchild(announcelabel)
Comments
Post a Comment