小编Geo*_*rge的帖子

多点触控不适用于iPhone的cocos2D

我对cocos2D非常熟悉(已经使用它超过1年了)我遇到了一个问题multitouch- 我的游戏 - multitouch.

我拥有的:
[glView setMultipleTouchEnabled:YES] 在我的代表中.一个playscene不实现触摸的.
添加到playcene的许多对象(我自己的,继承CCLayer).
这些对象实现了触摸并且是目标协议的委托.
[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];

在cocos2D的触摸测试中使用了相同的架构并且它正在工作.唯一的区别是它们使用CCSprite而不是CCLayer作为对象的父类.

有没有人有任何想法?

iphone multi-touch cocos2d-iphone

12
推荐指数
1
解决办法
765
查看次数

iOS 7 UITableViewCell 临时剪辑

我和其他人一样遇到了与 UITableViewCell 裁剪到其边界相同的问题。正如其他人正确指出的那样,单元格的 contentView 有一个新的超级视图。所以我这样做了:

- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *cellIdentifier = @"HomeTableViewCell";
    ItemCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    if(!cell)
    {
        cell = [[ItemCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
       //add views here as subviews to cell.contentView. Set them tags and retrieve later.
    }

    cell.clipsToBounds  = FALSE;
    cell.layer.masksToBounds = FALSE;
    cell.contentView.clipsToBounds = FALSE;
    cell.contentView.layer.masksToBounds = FALSE;
    cell.contentView.superview.clipsToBounds = FALSE;
    cell.contentView.superview.layer.masksToBounds = FALSE;

    [self loadCell:cell inTable:tableView atIndexPath:indexPath];

    return cell;
}
Run Code Online (Sandbox Code Playgroud)

loadCell: inTable: atIndexPath:通过标签检索单元格的子视图并加载正确的内容。效果很好。没有其他提及clipToBoundslayer.masksToBounds。但是:当我重新加载选定的单元格时,它会暂时剪辑到边界,然后它会点击上面的代码并得到正确的结果。因此,在大约 1-2 秒的时间里,我剪掉了细胞。这就是里面发生的事情ItemCell …

uitableview cliptobounds ios7

5
推荐指数
1
解决办法
1553
查看次数

如何在图像上执行快速像素化滤镜?

我的像素化图像处理算法有点问题.

我将图像从头开始加载到类型数组中.unsigned char* 之后,在需要时,我修改此数据并且必须更新图像.此更新需要很长时间.这就是我这样做的方式:

CGDataProviderRef dataProvider = CGProviderCrateWithData(.....);
CGImageRef cgImage = CGImageCreate(....);
[imageView setImage:[UIImage imageWithCGImage:cgImage]]];
Run Code Online (Sandbox Code Playgroud)

一切正常,但处理大图像的速度很慢.我尝试在后台线程上运行它,但这没有帮助.

所以基本上,这需要太长时间.有谁知道如何改进它?

iphone image-processing ios

3
推荐指数
1
解决办法
5044
查看次数