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

查看:106
本文介绍了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天全站免登陆