Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在XCode8下CGMutablePath的move方法报错 #2

Open
xtyDoge opened this issue Oct 16, 2016 · 2 comments
Open

在XCode8下CGMutablePath的move方法报错 #2

xtyDoge opened this issue Oct 16, 2016 · 2 comments

Comments

@xtyDoge
Copy link

xtyDoge commented Oct 16, 2016

更新Xcode8后CGMutablePath的move和addLine方法中的transform参数取nil会报错,去CGAffineTransform()则无法检测到碰撞体积

@NathanLNS
Copy link

Swift3的语法有变动,分别将主角和障碍的路径修改为新语法即可,以下修改部分以障碍物为例:

        let path = CGMutablePath()
        
        path.move(to: CGPoint(x:  4 - offsetX, y:   0 - offsetY))
        path.addLine(to: CGPoint(x:  7 - offsetX, y: 307 - offsetY))
        path.addLine(to: CGPoint(x: 47 - offsetX, y: 308 - offsetY))
        path.addLine(to: CGPoint(x: 48 - offsetX, y:   1 - offsetY))
        
        path.closeSubpath()

@shaoting0730
Copy link

@gonartlee 他的模板代码太旧了,怎么办?Resources里面的.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants