x


Adding a border to a minicam

How do you add a GUI border to a minicam (second smaller camera)?

more ▼

asked Apr 25 '12 at 06:42 AM

ina gravatar image

ina
3.3k 492 548 597

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Nothing fancy here, but for a "basic" mini-cam border all I did was add this to the minicamera object ->

#pragma strict
@script ExecuteInEditMode
 
var mySkin : GUISkin ;

function OnGUI(){
   if(mySkin)
      GUI.skin = mySkin ;
   var cam : Camera = transform.camera ;
   GUI.Box(Rect(cam.pixelRect.x, (Screen.height - cam.pixelRect.yMax), cam.pixelWidth, cam.pixelHeight), "") ;
}

Then made a gui skin for it, made the box->normal->background a 32x32 image with a transparent background and a 2px wide color-border around the edges.
Should be a decent starting point anyway, and could easily make it a little better with a "good" border image.

more ▼

answered Apr 25 '12 at 09:19 AM

Lo0NuhtiK gravatar image

Lo0NuhtiK
3.5k 1 9 39

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3673
x2987
x34
x1

asked: Apr 25 '12 at 06:42 AM

Seen: 735 times

Last Updated: Apr 25 '12 at 09:19 AM