ippa / jaws

Jaws - HTML5 canvas javascript 2D Game Framework
https://jawsjs.ippa.se
GNU Lesser General Public License v3.0
363 stars 75 forks source link

Sprite.image #36

Closed davidgomes closed 12 years ago

davidgomes commented 12 years ago

Changing the image of my sprite via:

my_sprite.image = "hello.png";

sprite.image is not working, I get "TypeError" on jaws.js.

my_sprite.setImage ("hello.png");

However, doing sprite.setImage ("new_image.png") is working.

ippa commented 12 years ago

browser/os?

davidgomes commented 12 years ago

Chromium 18/GNU Linux (Kernel version = 3.0.0-14)

ippa commented 12 years ago

setImage() will load an un-specified asset on the fly.. the simple sprite.image is a raw setter of image data.. so use setImage() and only image= if you need some extra boost. I don't think it's much of a difference though, I might just deprecate sprite.image= in total.