Jump to content

generateFrameNames TypeScript definition missing?


Karma Octopus
 Share

Recommended Posts

Another error in the TypeScript definitions file (I think) is that the frames property on makeParticles in Particles.Arcade.Emitter should be of type: number and not string[].

 

Right?: makeParticles( keys: string[], frames: number, quantity: number, collide: boolean, collideWorldBounds: boolean): Phaser.Particles.Arcade.Emitter;

 

Current: makeParticles( keys: string[], frames: string[], quantity: number, collide: boolean, collideWorldBounds: boolean): Phaser.Particles.Arcade.Emitter;

Link to comment
Share on other sites

Rich do you know if the source of phaser.d.ts should be enough up to date to run the simple code outlined here:

http://www.photonstorm.com/phaser/how-to-use-phaser-with-typescript

 

Had some problems initially (was on VS2012, updated to VS2013 fixed that). Thought I was clear, but I'm getting tons of error right of the bat when trying to compile the first go:

Error	34	Build: Supplied parameters do not match any signature of call target.	C:\Projekt\GameHyperia\GameHyperia\app.ts	4	32	GameHyperiaError	35	Build: Could not select overload for 'new' expression.	C:\Projekt\GameHyperia\GameHyperia\app.ts	4	32	GameHyperiaError	36	Build: Generic type references must include all type arguments.	C:\Projekt\GameHyperia\GameHyperia\phaser.d.ts	4	21	GameHyperiaError	37	Build: Duplicate identifier 'stage'.	C:\Projekt\GameHyperia\GameHyperia\phaser.d.ts	65	13	GameHyperiaError	38	Build: Generic type references must include all type arguments.	C:\Projekt\GameHyperia\GameHyperia\phaser.d.ts	147	21	GameHyperiaError	39	Build: Generic type references must include all type arguments.	C:\Projekt\GameHyperia\GameHyperia\phaser.d.ts	148	33	GameHyperiaError	40	Build: Generic type references must include all type arguments.	C:\Projekt\GameHyperia\GameHyperia\phaser.d.ts	904	32	GameHyperia[...tons of errors omitted for brevity...]Error	65	Build: Generic type references must include all type arguments.	C:\Projekt\GameHyperia\GameHyperia\phaser.d.ts	1798	80	GameHyperiaError	66	Build: Generic type references must include all type arguments.	C:\Projekt\GameHyperia\GameHyperia\phaser.d.ts	1800	46	GameHyperia

First error is for calling new Phaser.Game

 

Sorry I can't be more descriptive than that, still just getting around with typescript so far

 

Edit: Ok so after some tinkering I got it to compile.

I added two arguments to the new constructor call. Then I added TONS of <Object> type declarations to wherever the IDE showed an Array to be erroneous.

Am I going about it the right way? At the start of the file I have:

static GAMES: Array<Phaser.Game>;

But as for the rest of them (generics I think?) I just put Object.

Link to comment
Share on other sites

A easy way of change phaser.d.ts, is do a right-click in the class, and choose go to definition. Then check the definition in http://gametest.mobi/phaser/docs/ and put in the end of the class. Some properties of Sprite are inherited from Pixi DisplayObject, like Alpha. In this case I put directly in the Sprite class, for my use. But maybe for the repo this is not the best way.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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