SKColor clearColor 返回黑色? [英] SKColor clearColor returning a black color instead?

查看:42
本文介绍了SKColor clearColor 返回黑色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在启动过程中以以下方式设置了我的 SKScene:

I have setup my SKScene the following way during initiation:

-(id)initWithSize:(CGSize)size {
    if (self = [super initWithSize:size]) {


        self.backgroundColor = [SKColor clearColor];

    }
    return self;
}

但不知何故,我得到的是以下内容,它是黑色的,根本不清楚:

But somehow, what I am given is the following, which is black, not clear at all:

我在这里缺少什么?我怎样才能使这个场景清晰?我已经把持有场景的视图清晰了,但这仍然是我得到的.

What am I missing here? How can I make this scene clear? I have already made the view holding the scene clear yet this is still what I get.

更新:我也尝试设置 myView.opaque = NO; 但这根本没有帮助.

Update: I have also tried setting myView.opaque = NO; but this did not help at all.

推荐答案

将其设置为清除工作正常,导致没有颜色,所以黑色.

Setting it to clear is working correct, resulting in no colour, so black.

通过设置为您喜欢的任何颜色

Set to any colour you like via

self.backgroundColor = [SKColor colorWithRed:0.15 green:0.15 blue:0.3 alpha:1.0];

这篇关于SKColor clearColor 返回黑色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆