Massemassimo

Scaling a sprite to a certain width

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?

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.