Countdown/timer in Javascript

I’m basically trying to make an image fill up the whole screen, about 5 minutes after the game started, (in Javascript). I am a complete newbie to Javascript, so i have no idea how to do it. Help?

5 minutes is 60*5 seconds so:

    if (Time.timeSinceLevelLoad >= 60*5)
     //load the image here

You can delay the call of a method for a certain amount of time by using Invoke: Time Function in Javascript? - Questions & Answers - Unity Discussions

To display an image, use GUI.DrawTexture: Unity - Scripting API: GUI.DrawTexture

Good luck!

Its simple, try something like this:

//timer vars
var startTime;
var timer1:int;
var texture1: GUITexture;

function Update(){TimerStart();}

function TimerStart(){

startTime = Time.time; //time starter

timer1 = Time.time;  //Set time

if(timer1 > 5){ //<-------the number here are the seconds you want

Debug.Log ("Time is over, render texture now");

//Here we just enable a GUI texture on the screen (create a GUItexture and disable it)

texture1.enabled = true;


Basically you just wait for the time you want and then enable a texture that is already on the screen.