我需要按照我在附件中表示的方式组合三个图像:

1)一张图片是背景.它没有alpha通道意义上的"稳固".
2)另一个是精灵.雪碧躺在背景上.Sprite可能有自己的alpha通道,背景必须在sprite透明的地方可见.
3)有许多掩码:我每帧都对Sprite应用新的掩码.面具不是长方形.
换句话说,可见像素=背景像素,如果裁剪蒙版对应颜色为白色或精灵是透明的; 否则为精灵的像素(例如,相应的掩模的像素为黑色).
我正在使用cocos2d-iphone.我可以使用cocos2d-iphone或OpenGL ES 1.1进行组合吗?如果答案是肯定的,那么工作代码将不胜感激.如果两个答案都是NO,iOS上是否有其他技术可以制作我想要的东西(可能是Quartz2d或OpenGL ES 2.0)?
对于Sprite,蒙版格式不是强制性黑色,对于背景则是白色.我可以制作所需格式的蒙版,例如背景的透明度和Sprite的白色(如果需要).
PS还有另一个同样没有答案的问题: 可以改变iPhone上某些像素的alpha值吗?
我是iphone的初学者,在我的代码中由于未捕获的异常'NSInvalidArgumentException'而导致终止应用程序的运行时错误,原因:' - [__ NSCFString _isResizable]:无法识别的选择器发送到实例0x6e6e300'
我的代码是
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *path=[[NSBundle mainBundle] pathForResource:@"Animalfile" ofType:@"plist"];
NSDictionary *dict=[NSDictionary dictionaryWithContentsOfFile:path];
NSArray *animal=[dict valueForKey:@"image"];
NSLog(@"print:%@",dict);
NSLog(@"hello:%@",animal);
UIImage *img=[animal objectAtIndex:currentImage];
[animalphoto setImage:img];
}
Run Code Online (Sandbox Code Playgroud)
提供适用于我的代码的任何建议和源代码....
[EDIT]我已将我的设备装上。我在Github上找到了最新的私有API iOS-Runtime-Headers。
我想在我的应用中使用私有API。
我在github上找到了kennytm / iphone-private-frameworks,但它仅支持iOS3.x。当我在iOS 5.0.1上工作时。
我还在Google iPhone开发工具上找到了一些代码。但这确实让我感到困惑。我是iPhone开发的新手。
我应该怎么用
[[UIApplication sharedApplication] launchApplicationWithIdentifier:@"com.a.b" suspended:NO];
Run Code Online (Sandbox Code Playgroud)
有人可以给我一个方向或一些例子。非常感谢。
我应该如何用MKStoreKit实现两个消耗品?如果我有两个消耗品,例如"少量硬币"(10个硬币)和"带硬币的袋子"(100个硬币).我有两个问题:
产品ID应该如何?
如何获得所购买硬币的总金额,包括少数几个和一个或多个硬币?
Amount = 10*handfuls_purchased + 100*bags_purchased;
Run Code Online (Sandbox Code Playgroud)我已经在正式的MKStoreKit博客上阅读了教程,但我仍然无法解决这个问题.
Ps我正在使用MKStoreKit 3.1并且因为ARC而无法更新到更新的版本(我的项目不支持它)
我开发了一个迷你shell,接受来自stdin的文本.它到目前为止工作,但我需要让它返回(在>之前的小东西)
他们登录的机器名称和当前工作目录.
我有
#include <unistd.h>
Run Code Online (Sandbox Code Playgroud)
在代码中,当前的工作目录是使用getcwd(2)得到的,它工作正常,但gethostname(2)似乎不起作用.它不会在MINGW32上使用gcc进行编译,给出错误:未定义的引用到'gethostname'colle2:ld重新出现1退出状态.
到目前为止,这是我的代码.
#include <stdio.h>
#include <string.h>
#include <unistd.h>
static int LINE_MAX = 10000;
static char *cmdLine = "Samcmd --> ";
int main( int argc, char *argv[] )
{
char cwd[LINE_MAX];
char hostName[LINE_MAX];
int looper = 1;
char *token = NULL;
char line[LINE_MAX];
char *placehold = NULL;
getcwd(cwd, LINE_MAX - 1);
gethostname(hostName, LINE_MAX - 1);
while ( looper == 1 )
{
printf( "%s | %s", hostName, cmdLine );
if( fgets( line, LINE_MAX, stdin ) != …Run Code Online (Sandbox Code Playgroud)