目标 C:起点和终点
我正在用手指应用程序画画。
我想设置一个起点和终点。
我的项目是这样的,它有一个背景,会告诉你画的方向。当用户到达终点时,背景将会改变。
我试过这个... 触摸开始...
drawPoint = [touch locationInView:self.view];
CGRect writingStartPoint = CGRectMake(90, 800, 30, 30);
CGRect writingEndPoint = CGRectMake(390, 800, 30, 30);
if (CGRectContainsPoint(writingStartPoint, drawPoint))
{
//something
}
if (CGRectContainsPoint(writingEndPoint, drawPoint))
{
//change background
}
它不起作用。
还有别的办法吗?
i am making a drawing with finger app.
I want to set a start point and end point.
My project is like this, it has a background that will tell you the direction to draw. when the user hits the end point the background will change.
i tried this...
On touches began...
drawPoint = [touch locationInView:self.view];
CGRect writingStartPoint = CGRectMake(90, 800, 30, 30);
CGRect writingEndPoint = CGRectMake(390, 800, 30, 30);
if (CGRectContainsPoint(writingStartPoint, drawPoint))
{
//something
}
if (CGRectContainsPoint(writingEndPoint, drawPoint))
{
//change background
}
it's not working.
Is there another way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该检查触摸移动或结束方法上是否触摸结束矩形
you should check is touch in end rectangle on touch moved or ended method