- Home /
Found the answer right after I posted it...
texture2D opacity?(javascript)
Hello again! So I'm trying to create a crosshair for an FPS but I don't want it covering the center of the screen so I want to change the opacity. But how? I've found C# tutorials on it but I need a javascript solution. It would be great if I could change it outside the code but if I have to write some extra code here's my script just in case:
#pragma strict
var CrosshairTex : Texture2D; //The texture variable
var Params: Rect; //The crosshair parameters variable.
function Update() {
Params= Rect(375,150,25,25);//Setting the parameters
}
function OnGUI() {
GUI.DrawTexture(Params, CrosshairTex); //Drawing the crosshair.
}
There's my code. please don't give me new ways to do this unless it is absolutely necessary for this purpose. Please help! Thanks!
P.S: Could I please have the method to do this in unity? I'm not very experienced with my 2d graphics software(inkscape).
Follow this Question
Related Questions
Can someone help me fix my Javascript for Flickering Light? 6 Answers
ReadPixels Overlaying Opacity 0 Answers
Rotate 2D Texture negative positive degrees touch 2 Answers
New GameObject with GUITexture is a Horribly Incorrect Size 1 Answer
Swap texture2D on enemy sprite once reached a certain point 1 Answer