Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2169
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Blurred Background GUI Script (will need UnityPro for example)

on Thu Aug 14, 2014 5:26 am
oohy gohy we get into the good stuff now!
This tutorial will show you how to add a simple GUI that you switch to and the background is blurred.
since the gui does not represent physical 3d space, the blur does not overpass the UI.
ok, let's get started.


phew..here is some code Smile

Code:

#pragma strict
var playerCam : Camera;
var GUICam : Camera;
var justsometext : String;

function Start () {
playerCam.enabled = true;
GUICam.enabled = false;
justsometext = "Look at this cool GUI!";
//this will not cover all of what you put on the GUICam, please scroll down further
//thank you


}

function Update () {
if(Input.GetKeyDown("2")) {
playerCam.enabled = false;
GUICam.enabled = true;

}
if(Input.GetKeyUp("2")) {
playerCam.enabled = true;
GUICam.enabled = false;
}



}

function OnGUI () {

GUILayout.Label(justsometext.toString());

}



Ok now that's out of the way, that should be a solid script.

now apply the DepthOfField34 script in the image effects folder to the GUICam
(Unity Pro Required)
now you should be able to get a good result.
Thank you guys!
-BryceCain25

avatar
Admin
Admin
Posts : 608
Points : 3197
Rep : 406
Join date : 2013-12-11
Age : 21
View user profilehttps://www.youtube.com/user/misterninjaboy

Re: Blurred Background GUI Script (will need UnityPro for example)

on Sat Sep 27, 2014 8:00 pm
Very interesting! Unfortunately I do not have a copy of pro atm to test this method.
avatar
Moderator
Moderator
Posts : 76
Points : 1954
Rep : 16
Join date : 2014-06-02
Age : 15
Location : Milky Way
View user profile

Re: Blurred Background GUI Script (will need UnityPro for example)

on Tue Sep 30, 2014 5:06 pm
must be pretty cool! if only i had a copy of UNTIY PRO
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2169
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: Blurred Background GUI Script (will need UnityPro for example)

on Tue Sep 30, 2014 11:38 pm
MisterNinjaBoy wrote:Very interesting! Unfortunately I do not have a copy of pro atm to test this method.
Yeah, sorry about that Sad
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2169
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: Blurred Background GUI Script (will need UnityPro for example)

on Tue Sep 30, 2014 11:39 pm
wooden_sword789 wrote:must be pretty cool! if only i had a copy of UNTIY PRO
It is a very cool effect Very Happy
Back to top
Permissions in this forum:
You cannot reply to topics in this forum