Skip to content
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

Merged
merged 4 commits into from
Feb 12, 2020
Merged

Convert sprite-tiling to TypeScript #6398

merged 4 commits into from
Feb 12, 2020

Conversation

Zyie
Copy link
Member

@Zyie Zyie commented Feb 10, 2020

Description of change

Ok so slight complication with this one and not sure the best way round it.

The TilingSprite.from method isnt compatible with Sprite.from as Sprite.from takes a texture and some options whereas TilingSprite.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
  • Tests and/or benchmarks are included
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

@codecov-io
Copy link

codecov-io commented Feb 11, 2020

Codecov Report

Merging #6398 into dev will increase coverage by 0.11%.
The diff coverage is 75%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
...s/canvas/canvas-sprite/src/CanvasSpriteRenderer.js 65.51% <100%> (ø) ⬆️
packages/canvas/canvas-renderer/src/BaseTexture.js 100% <100%> (ø) ⬆️
packages/canvas/canvas-mesh/src/NineSlicePlane.js 89.36% <50%> (-1.75%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5b570d...62cc701. Read the comment docs.

@Zyie Zyie marked this pull request as ready for review February 11, 2020 17:34
@@ -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
Copy link
Member

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?

Copy link
Member

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.

@bigtimebuddy bigtimebuddy merged commit ff76f32 into dev Feb 12, 2020
@bigtimebuddy bigtimebuddy deleted the dev-tiling-typescript branch February 12, 2020 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants