ios - Why is my rectangle being drawn wrong? -
i'm trying draw rectangle around screen. here's code:
let viewrect = skshapenode(rect: self.view!.frame) viewrect.strokecolor = skcolor.whitecolor() viewrect.linewidth = 2.0 addchild(viewrect)
i'm using self.view!.frame
instead of self.frame
because scene not same size screen (the scene stretched fill screen).
i have expected code draw rectangle around screen, draws instead (the white rectangle drawn):
anyone know why it's not being drawn around screen?
scene size: 1024x768 view size: 414x736 scale mode: aspect fill
you creating border node within scene setting coordinates according view presenting scene. skscene's coordinate system not same view presenting why shape different expect.
Comments
Post a Comment