基础涂料应用程序绘画

时间:2016-01-31 20:32:40

标签: ios swift sprite-kit

基本绘画应用程序,其中圆圈在画布中移动。当圆圈在画布中移动时,它应该画出那个区域。

我得到光标的位置(蓝色圆圈)来帮助确定我应该填充的路径。到最后,我将移动蓝色光标​​,直到我填充橙色。

在ios API中,有没有可以让我这样做? 我虽然操纵ImageSkNode路径。或者是否有一些我可以使用的画布对象?

enter image description here

func updateCanvas(players : [PlayerNode]){
    let copyPath = CGPathCreateMutableCopy(self.path) //get the last frame path
    for player in players{
        if self.intersectsNode(player){
          let posistion = player.position

          //CGPathAddEllipseInRect(copyPath, nil, CGRectMake(position.x, posistion.y, 50 , 50))

        }
    }

    self.path = copyPath

}

0 个答案:

没有答案
相关问题