Add function setTexture.