-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert sprite-tiling to TypeScript #6398
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #6398 +/- ##
==========================================
+ Coverage 77.86% 77.97% +0.11%
==========================================
Files 68 67 -1
Lines 3885 3769 -116
==========================================
- Hits 3025 2939 -86
+ Misses 860 830 -30
Continue to review full report at Codecov.
|
@@ -280,7 +283,7 @@ export class TilingSprite extends Sprite | |||
* @param {number} height - the height of the tiling sprite | |||
* @return {PIXI.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId | |||
*/ | |||
static fromFrame(frameId, width, height) | |||
static fromFrame(frameId: string, width: number, height: number): TilingSprite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bigtimebuddy - fromFrame and fromImage ... we deprecated these for Sprites and Textures in favour of just 'from' for v5, but looks like this got missed. Is there a case for doing that here too? Or wait until post TS conversion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather do that as a follow up PR, but you’re right that was missed.
Description of change
Ok so slight complication with this one and not sure the best way round it.
The
TilingSprite.from
method isnt compatible withSprite.from
asSprite.from
takes a texture and some options whereasTilingSprite.from
takes a texture, width, height.The solution i have committed here is:
static from(source: TextureSource, options: ISize): TilingSprite
If anyone has better ideas let me know!
Pre-Merge Checklist
npm run lint
)npm run test
)