Computer Science Canada

image function?

Author:  TrAnCeIn4LiFe [ Fri Jun 18, 2004 8:46 pm ]
Post subject:  image function?

how could u make an image to be a function?

Author:  SuperGenius [ Fri Jun 18, 2004 9:25 pm ]
Post subject: 

what goal are you trying to accompish?

Author:  TrAnCeIn4LiFe [ Fri Jun 18, 2004 9:29 pm ]
Post subject: 

ah make an image be returned inside a function like attack ability but in function statment not process.

Author:  Tony [ Fri Jun 18, 2004 9:45 pm ]
Post subject: 

then you return the integer pointer to the picture.

code:

var pic1 : int := Pic.FileNew ("whatever")
var pic2 : int := Pic.FileNew ("whateverelse")

function whatPicture () : int

    if Rand.Int (0, 1) = 1 then
        result pic1
    else
        result pic2
    end if

end whatPicture

Pic.Draw (whatPicture (), x, y, picCopy)


: