- Home /
Question by
Unstable56 · Nov 29, 2015 at 09:59 AM ·
javascriptuicanvas
Changing source image for canvas image via javascript
I am creating a health bar for my UI, I have the health bar as a sprite sheet with a different sprite for each value I want to change the source image for the Image game object whenever the players health goes down by ten since nothing in the game currently does more or less damage, problem is I don't know how you write that in code
I currently have
function Update () {
if (PlayerScript.currentHealth == 90){
change image code here
}
Comment