2D Toolkit Forum
2D Toolkit => Support => Topic started by: DemiGoth on February 13, 2014, 08:08:46 am
-
I'm trying to figure out how to change the camera background color. As far as I can see, there's only an to GET the background settings and not SET it. Is this correct? If not, how can I SET the camera background color?
-
just set camera.backgroundColor?
-
Tried that one already and I get "Assets/Scripts/MainGame.cs(168,40): error CS1955: The member `UnityEngine.Camera.backgroundColor' cannot be used as method or delegate" when I use camera.backgroundColor(Color.blue).
When I use myCamera.backgroundColor(Color.blue) (derived from tk2dCamera) I get "Assets/Scripts/MainGame.cs(168,42): error CS1061: Type `tk2dCamera' does not contain a definition for `backgroundColor' and no extension method `backgroundColor' of type `tk2dCamera' could be found (are you missing a using directive or an assembly reference?)".
-
Why on earth are you calling it as a method? You just need to assign the value,
camera.backgroundColor = Color.blue;
-
camera.backgroundColor = Color.blue; Works, but only on the normal camera. The tk2dCamera doesn't allow this to be used. Did you remove the tk2dCamera on your latest release?
-
backgroundCOlor is a property on the camera, not the tk2dCamera, so z.camera.backgroundColor will work
-
Okay, that's clear. But how do I change the background color of the tk2dCamera that I'm using? In your tutorials you state clearly that you need to remove the default (3D) camera and use the tk2dCamera instead. And with that one not having a backgroundColor property I'm wondering how to set it.
I did use camera.BackgroundColor=Color.blue, and the camera (when I added it) did change to blue, but as said above, it's not showing up on the tk2dCamera.
-
Get a reference to your camera by dragging and dropping then do mytk2dCameraVar.camera.backgroundColor. Pretty much the usual stuff you'd do in Unity.
-
Just shoot me... Tried this before and it was not working and now it is ...or I must have made a typo somewhere :-\ ANyway, it's working now and BIG THANKS for the help AND patience :-*