Jump to content

Scaling a sprite to a certain width


Massemassimo
 Share

Recommended Posts

Hey,

 

since sprite.scale.setTo takes factors instead of a target pixel amount, I was looking for another way to change the size. Since I didn't find anything about that in the phaser doc and phaser.sprite derives from the pixi.js sprite, I checked the pixi doc and found sprite.width() and .height().

 

Sadly for sprite.width(x); typescript tells me I "cannot invoke an expression whose type lacks a call signature." Is this a type definition file problem? How could I change the definitions file to make it work?

Link to comment
Share on other sites

sorry for hijacking the thread, but it also has to do with sprite.width. :)

 

i'm missing a way to get the image dimenstion values, like:

var image_width =  sprite.width();

Is it possible somehow?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...