Commit graph

942 commits

Author SHA1 Message Date
photonstorm
def662f28f Text.setShadow has had the default color value changed from rgba(0,0,0,0) to rgba(0,0,0,1) so it appears as a black shadow by default - before the alpha channel made it invisible. 2014-12-02 09:03:55 +00:00
photonstorm
5b6e41b112 Readme updated. 2014-12-02 09:03:55 +00:00
photonstorm
30d2d1973a readme update. 2014-11-27 21:33:21 +00:00
photonstorm
fb733ddcca onPreRenderCallback wasn't being cleared on a State swap. 2014-11-26 13:12:51 +00:00
photonstorm
667d477a16 P2.BodyDebug always lagged behind the position of the Body it was tracking by one frame, which became visible at high speeds. It now syncs its position in the Body.postUpdate which prevents this from happening (thanks @valueerror) 2014-11-25 22:21:11 +00:00
photonstorm
e86f00eb55 Text.lineSpacing works correctly again. Before no space was added between the lines (thanks @intimidate #1367 and @brejep #1366) 2014-11-25 17:06:17 +00:00
photonstorm
72eaee3139 Adjusted Sprite.preUpdate to remove the lifespan calculation. 2014-11-25 14:18:18 +00:00
photonstorm
7aaa63e7a5 When you change State the P2 Physics world is no longer fully cleared. All of the bodies, springs, fixtures, materials and constraints are removed - but config settings such as gravity, restitution, the contact solver, etc are all retained. The P2.World object is only created the very first time you call Physics.startSystem. Every subsequent call hits P2.World.reset instead (#1292) 2014-11-25 12:09:03 +00:00
photonstorm
54e79f5b25 Grunt and docs updates. 2014-11-25 00:24:29 +00:00
photonstorm
4ecd7f99a8 Docs update. 2014-11-24 11:12:09 +00:00
photonstorm
1928427bcb Phaser TypeScript defs fixes. 2014-11-23 11:32:13 +00:00
photonstorm
874f60c1bc Removed CocoonJS hack - woohoo! 2014-11-21 10:40:18 +00:00
photonstorm
7e4a494f13 Keyboard.justPressed has bee renamed to Keyboard.downDuration which is a much clearer name for what the method actually does.
Keyboard.justReleased has bee renamed to Keyboard.upDuration which is a much clearer name for what the method actually does.
Keyboard.downDuration, Keyboard.upDuration and Keyboard.isDown now all return `null` if the Key wasn't found in the local keys array.
2014-11-20 20:55:51 +00:00
photonstorm
88ea3412dc Fixes issue where Tween.from didn't set the target properties until after the delay was up. 2014-11-20 20:42:10 +00:00
photonstorm
2589000435 Tweens have been completely rewritten. They're now much more flexible and efficient than before:
When specifying the ease in `Tween.to` or `Tween.from` you can now use a string instead of the Function. This makes your code less verbose. For example instead of `Phaser.Easing.Sinusoidal.Out` and you can now just use the string "Sine".The string names match those used by TweenMax and includes: "Linear", "Quad", "Cubic", "Quart", "Quint", "Sine", "Expo", "Circ", "Elastic", "Back", "Bounce", "Power0", "Power1", "Power2", "Power3" and "Power4". You can append ".easeIn", ".easeOut" and "easeInOut" variants. All are supported for each ease types.
Tweens now create a TweenData object. The Tween object itself acts like more of a timeline, managing multiple TweenData objects. You can now call `Tween.to` and each call will create a new child tween that is added to the timeline, which are played through in sequence.
Tweens are now bound to the new Time.desiredFps value and update based on the new Game core loop, rather than being bound to time calculations. This means that tweens are now running with the same update logic as physics and the core loop.
Tween.timeScale allows you to scale the duration of a tween (and any child tweens it may have). A value of 1.0 means it should play at the desiredFps rate. A value of 0.5 will run at half the frame rate, 2 at double and so on. You can even tween the timeScale value for interesting effects!
Tween.reverse allows you to instantly reverse an active tween. If the Tween has children then it will smoothly reverse through all child tweens as well.
Tween.repeatAll allows you to control how many times all child tweens will repeat before firing the Tween.onComplete event. You can set the value to -1 to repeat forever.
Tween.loop now controls the looping of all child tweens.
Tween.onRepeat is a new signal that is dispatched whenever a Tween repeats. If a Tween has many child tweens its dispatched once the sequence has repeated.
Tween.onChildComplete is a new signal that is dispatched whenever any child tweens have completed. If a Tween consists of 4 sections you will get 3 onChildComplete events followed by 1 onComplete event as the final tween finishes.
Chained tweens are now more intelligently handled. Because you can easily create child tweens (by simply calling Tween.to multiple times) chained tweens are now used to kick-off longer sequences. You can pass as many Tween objects to `Tween.chain` as you like as they'll all be played in sequence. As one Tween completes it passes on to the next until the entire chain is finished.
Tween.stop has a new `complete` parameter that if set will still fire the onComplete event and start the next chained tween, if there is one.
Tween.delay, Tween.repeat, Tween.yoyo, Tween.easing and Tween.interpolation all have a new `index` parameter. This allows you to target specific child tweens, or if set to -1 it will update all children at once.
Tween.totalDuration reports the total duration of all child tweens in ms.
There are new easing aliases:
* Phaser.Easing.Power0 = Phaser.Easing.Linear.None
* Phaser.Easing.Power1 = Phaser.Easing.Quadratic.Out
* Phaser.Easing.Power2 = Phaser.Easing.Cubic.Out
* Phaser.Easing.Power3 = Phaser.Easing.Quartic.Out
* Phaser.Easing.Power4 = Phaser.Easing.Quintic.Out
2014-11-20 06:06:26 +00:00
photonstorm
aa72cf63c1 Emitter.setScale fixed minX minY order presedence (thanks spayton) 2014-11-18 15:38:08 +00:00
photonstorm
07d43934c6 Docs update. 2014-11-18 12:43:26 +00:00
photonstorm
21479acd8e Sprite.autoCull now properly works if the camera moves around the world.
Sprite.inCamera uses a much faster check if auto culling or world bounds checks are enabled and properly adjusts for camera position.
2014-11-18 12:29:55 +00:00
photonstorm
5cd4225412 If you are reloading a Phaser Game on a page that never properly refreshes (such as in an AngularJS project) then you will quickly run out of AudioContext nodes. If this is the case create a global var called PhaserGlobal on the window object before creating the game. The active AudioContext will then be saved to window.PhaserGlobal.audioContext when the Phaser game is destroyed, and re-used when it starts again (#1233) 2014-11-16 21:05:31 +00:00
photonstorm
b635ca511e docs update 2014-11-16 19:13:53 +00:00
photonstorm
02665076e6 Docs updates. 2014-11-15 19:50:03 +00:00
photonstorm
d8d2ebdb31 Phaser 2.2.0 - Release Candidate 6. 2014-11-14 08:16:55 +00:00
photonstorm
527934d909 Key.justPressed has bee renamed to Key.downDuration which is a much clearer name for what the method actually does. See Key.justDown for a nice clean alternative.
Key.justReleased has bee renamed to Key.upDuration which is a much clearer name for what the method actually does. See Key.justUp for a nice clean alternative.
Key.justDown allows you to test if a Key has just been pressed down or not. You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. This allows you to use it in situations where you want to check if this key is down without using a Signal, such as in a core game loop (thanks @pjbaron #1321)
Key.justUp allows you to test if a Key has just been released or not. You can only call justUp once per key press. It will only return `true` once, until the Key is pressed down and released again. This allows you to use it in situations where you want to check if this key is up without using a Signal, such as in a core game loop (thanks @pjbaron #1321)
2014-11-13 13:01:58 +00:00
photonstorm
b855df2656 Docs update. 2014-11-13 12:39:32 +00:00
photonstorm
e7356fc575 Pixi 2.1.1 merge. 2014-11-12 22:38:51 +00:00
photonstorm
515dff3b04 docs updated 2014-11-12 22:28:49 +00:00
photonstorm
1352b526c7 Merged final Pixi v2.1.0 release. 2014-11-11 23:24:50 +00:00
photonstorm
da031d8bbb Phaser games should now work again from the CocoonJS Launcher. 2014-11-11 14:31:20 +00:00
photonstorm
042ceeb59d Docs update. 2014-11-11 05:56:38 +00:00
photonstorm
bf70df2658 Game.forceSingleUpdate will force just a single logic update, regardless of the delta timer values. You can use this in extremely heavy CPU situations where you know you're about to flood the CPU but don't want Phaser to get stuck in a spiral. 2014-11-11 05:51:56 +00:00
photonstorm
a2b7d339a2 Tilemap.createFromTiles will convert all tiles matching the given tile index (or an array of indexes) into Sprites. You can optionally then replace these tiles if you wish. This is perfect for games when you want to turn specific tiles into Sprites for extra control. The Sprites have an optional properties object which they can be populated with. 2014-11-11 01:05:59 +00:00
photonstorm
8bf93fb658 ArcadePhysics.skipQuadTree is now set to true by default. A QuadTree is a wonderful thing if the objects in your game are well spaced out. But in tightly packed games, especially those with tilemaps or single-screen games, they are a considerable performance drain and eat up CPU. We've taken the decision to disable the Arcade Physics QuadTree by default. It's all still in there and can be re-enabled via game.physics.arcade.skipQuadTree = false, but please only do so if you're sure your game benefits from this. 2014-11-11 01:05:58 +00:00
photonstorm
547e7a4d1d docs update 2014-11-09 23:15:30 +00:00
photonstorm
0a86a7ef51 Time.now can no longer be relied upon to contain a timestamp value. If the browser supports requestAnimationFrame then Time.now will contain the high resolution timer value that rAf generates. Otherwise it will contain the value of Date.now. If you require the actual time value (in milliseconds) then please use Time.time instead. Note that all Phaser sub-systems that used to rely on Time.now have been updated, so if you have any code that extends these please be sure to check it. 2014-11-08 20:01:10 +00:00
photonstorm
71507c5487 Moving to 2.2.0 release version. 2014-11-08 19:25:47 +00:00
photonstorm
a0cc4c3777 A large refactor to how the internal game timers and physics calculations has been made. We've now swapped to using a fixed time step internally across Phaser, instead of the variable one we had before that caused glitchse on low-fps systems. Thanks to pjbaron for his help with all of these related changes.
We have separated the logic and render updates to permit slow motion and time slicing effects. We've fixed time calling to fix physics problems caused by variable time updates (i.e. collisions sometimes missing, objects tunneling, etc)

Once per frame calling for rendering and tweening to keep things as smooth as possible

Calculates a `suggestedFps` value (in multiples of 5 fps) based on a 2 second average of actual elapsed time values in the `Time.update` method.  This is recalculated every 2 seconds so it could be used on a level-by-level basis if a game varies dramatically. I.e. if the fps rate consistently drops, you can adjust your game effects accordingly.

Game loop now tries to "catch up" frames if it is falling behind by iterating the logic update. This will help if the logic is occasionally causing things to run too slow, or if the renderer occasionally pushes the combined frame time over the FPS time. It's not a band-aid for a game that floods a low powered device however, so you still need to code accordingly. But it should help capture issues such as gc spikes or temporarily overloaded CPUs.

It now detects 'spiralling' which happens if a lot of frames are pushed out in succession meaning the CPU can never "catch up". It skips frames instead of trying to catch them up in this case. Note: the time value passed to the logic update functions is always constant regardless of these shenanigans.

Signals to the game program if there is a problem which might be fixed by lowering the desiredFps

Time.desiredFps is the new desired frame rate for your game.

Time.suggestedFps is the suggested frame rate for the game based on system load.

Time.slowMotion allows you to push the game into a slow motion mode. The default value is 1.0. 2.0 would be half speed, and so on.

Time.timeCap is no longer used and now deprecated. All timing is now handled by the fixed time-step code we've introduced.
2014-11-08 18:54:54 +00:00
photonstorm
55953078d0 FrameData.clone fixed when cloning data using frame names rather than indexes (thanks pjbaron) 2014-11-08 17:08:29 +00:00
photonstorm
0f3849491d P2.BodyDebug circles were drawing at half widths (thanks @enriqueto #1288) 2014-11-08 14:09:26 +00:00
photonstorm
19d8773ca6 readme updates. 2014-11-08 13:42:23 +00:00
photonstorm
2777c2a463 ScaleManager.elementBounds is a cross-browser element.getBoundingClientRect method with optional cushion.
ScaleManager.calibrate is a private method that calibrates element coordinates for viewport checks.
ScaleManager.aspect gets the viewport aspect ratio (or the aspect ratio of an object or element)
ScaleManager.inViewport tests if the given DOM element is within the viewport, with an optional cushion parameter that allows you to specify a distance.
ScaleManager.scaleSprite takes a Sprite or Image object and scales it to fit the given dimensions. Scaling happens proportionally without distortion to the sprites texture. The letterBox parameter controls if scaling will produce a letter-box effect or zoom the sprite until it fills the given values.
ScaleManager.viewportWidth returns the viewport width in pixels.
ScaleManager.viewportHeight returns the viewport height in pixels.
ScaleManager.documentWidth returns the document width in pixels.
ScaleManager.documentHeight returns the document height in pixels.
2014-11-08 13:31:35 +00:00
photonstorm
7e404604d3 docs update. 2014-11-04 23:57:21 +00:00
photonstorm
be8499fa49 Moved ts defs to new home. 2014-11-02 23:00:15 +00:00
photonstorm
807e443a31 The Input class has been given a minor refactor to tidy things up. Specifically:
* pointerN are aliases to backed pointers[N-1] array. This simplifies (and increases the efficiency of) looping through all the pointers when applicable; also eliminates pointer-existance checks Removes various hard-coded limits (added MAX_POINTERS); changed maxPointers default
    * Removed some special-casing from cases where it did not matter
    * Removed === false/true, == usage for consistency, changed missing value check to typeof, etc.
    * Updated documentation for specificty; added @public\@protected
    * @deprecated currentPointers due to odd set pattern; totalCurrentPointers is more appropriate.
(thanks @pnstickne #1283)
2014-11-02 12:26:46 +00:00
photonstorm
97edb7b830 Pointer.addClickTrampoline now adds in support for click trampolines. These raise pointer events into click events, which are required internally for a few edge cases like IE11 full screen mode support, but are also useful if you know you specifically need a DOM click event from a pointer (thanks @pnstickne #1282) 2014-11-02 12:18:23 +00:00
photonstorm
8b2628d99c All of the Input classes now use the more consistent enabled property instead of disabled. I.e. you can now check if (input.mouse.enabled) rather than if (!input.mouse.disabled). The disabled property has been moved to a getter for backwards compatibility but is deprecated and will be removed in a future version (thanks @pnstickne #1257) 2014-11-02 12:14:47 +00:00
photonstorm
e853cb14bb readme update 2014-11-02 11:04:03 +00:00
photonstorm
59b25ab6bb Animation.setFrame used the wrong frames array if useLocalFrameIndex was false and a numeric frame ID was given (thanks @Skeptron #1284) 2014-11-02 11:04:03 +00:00
photonstorm
e57c700816 The Gamepad.addCallbacks context parameter was never actually remembered, causing the callbacks to run in the wrong context (thanks @englercj #1285) 2014-11-02 11:04:02 +00:00
photonstorm
ce32d492af Phaser.Polygon has been refactored to address some Pixi v2 migration issues (thanks @pnstickne for the original implementation #1267)
Polygon.area is now only calculated when the Polygon points list is modified, rather than on every call.

Phaser.Polygon can now accept the points list in a variety of formats: Arrays of Points, numbers, objects with public x/y properties or any combination of, or as a parameter list (thanks @pnstickne for the original implementation #1267)

Polygon.contains now correctly calculates the result  (thanks @pnstickne @BurnedToast #1267)
2014-10-29 07:46:56 +00:00
photonstorm
dc20ab6020 Text.updateText was incorrectly increasing the size of the texture each time it was called (thanks @spayton #1261) 2014-10-29 07:46:56 +00:00
photonstorm
d1b79f90a5 Polygon.contains was toggling the return value on each valid hit (thanks @Singularetantum #1265 #1266) 2014-10-29 07:46:56 +00:00
photonstorm
1df98d82e3 You can now call Tween.to again on a Tween that has already completed. This will re-use the same tween, on the original object, without having to recreate the Tween again. This allows a single tween instance to be re-used multiple times, providing they are linked to the same object (thanks InsaneHero) 2014-10-28 01:49:20 +00:00
photonstorm
dfa442db93 Particle.Emitter will now automatically set particle.body.skipQuadTree to true to help with collision speeds within Arcade Physics.
Particle.Emitter.explode (or `Emitter.start` with the `explode` parameter set to `true`) will immediately emit the required quantity of particles and not delay until the next frame to do so. This means you can re-use a single emitter across multiple places in your game that require explode-style emissions, just by adjusting the `emitter.x` and `emitter.y` properties before calling explode (thanks Insanehero)
2014-10-27 23:29:43 +00:00
photonstorm
a471cfc235 Game.destroy now destroys either the WebGLRenderer or CanvasRenderer, whichever Pixi was using. 2014-10-27 22:09:39 +00:00
photonstorm
da87c75e00 Loader.useXDomainRequest used to be enabled automatically for IE9 but is now always set to false. Please enable it only if you know your server set-up / CDN requires it, as some most certainly do, but we're finding them to be less and less used these days, so we feel it's safe to now disable this by default (#1248)
Loader.json was using the wrong context in IE9 with XDomainRequest calls (thanks @pnstickne #1258)
2014-10-27 12:31:55 +00:00
photonstorm
0f3cda0aed Cache.getRenderTexture will retrieve a RenderTexture that is stored in the Phaser Cache. This method replaces Cache.getTexture which is now deprecated.
Cache.autoResolveURL is a new boolean (default `false`) that automatically builds a cached map of all loaded assets vs. their absolute URLs, for use with Cache.getURL and Cache.checkURL. Note that in 2.1.3 and earlier this was enabled by default, but has since been moved behind this property which needs to be set to `true` *before* you load any assets to enable.

Cache._resolveUrl has been renamed to Cache._resolveURL internally and gained a new parameter. This method is a private internal one.

Cache.getUrl is deprecated. The same method is now available as Cache.getURL.

XML files weren't being added to the URL map.

Cache._resolveURL was causing a Sound double-load in Firefox and causing errors (thanks @domonyiv #1253)
2014-10-27 11:46:24 +00:00
photonstorm
12c2f83bfc Repackaging for 2.1.4 release. 2014-10-27 10:59:37 +00:00
Richard Davey
35c42e3073 Tilemaps in WebGL wouldn't update after the first frame due to a subtle change in how Pixi uploads new textures to the GPU. 2014-10-25 10:09:04 +01:00
photonstorm
18f6b320ab Preparing for Phaser v2.2.0 2014-10-23 13:52:39 +01:00
photonstorm
fbe68e330d Phaser 2.1.3 build. 2014-10-22 21:42:12 +01:00
photonstorm
9b16b11c88 Small Roadmap update. 2014-10-21 22:45:36 +01:00
photonstorm
01a068f53c Rectangle.scale allows you to scale the width and height of a Rectangle. 2014-10-21 00:25:54 +01:00
photonstorm
9d58297eb9 Button.setSounds now works if given an AudioSprite as the sound source. 2014-10-20 23:17:05 +01:00
photonstorm
1a357e18c8 Rectangle contains updates. 2014-10-20 14:28:09 +01:00
photonstorm
b580746cb8 Input.hitTest now accurately detects hits on the extreme edges of a display object (thanks InsaneHero) 2014-10-20 14:28:09 +01:00
photonstorm
d70406588c Filter.update now caches the previous pointer position to avoid flooding the uniform. Also the mouse uniform is now a value between 0 and 1 depending on the position within the game view. 2014-10-17 19:29:50 +01:00
photonstorm
f0b7670506 Fixed an issue where audio files with query strings after them would fail the canPlayAudio checks (thanks Vithar) 2014-10-17 18:50:12 +01:00
photonstorm
52f1663642 Fixed the Filter mouse uniform value population. 2014-10-17 16:52:28 +01:00
photonstorm
4f1ba99120 BitmapData.getFirstPixel will scan the BitmapData and return the color and location of the first non-transparent pixel encountered. You can specify one of 4 scan directions: top to bottom, bottom to top, left to right and right to left.
BitmapData.getBounds will return a `Rectangle` object that encompasses the full extent of the non-transparent pixels in the BitmapData. This can be useful if you wish to trim away transparent pixels from the sides of a BitmapData down to size before saving.
2014-10-17 16:51:50 +01:00
photonstorm
fbfb107146 JSDoc fixes in the Rope class (thanks @Rovanion) 2014-10-15 22:05:38 +01:00
photonstorm
2657de0daa Sound.fadeTo allows you to fade the Sound to the given volume over the duration specified (thanks @nickryall #1225) 2014-10-15 21:48:00 +01:00
photonstorm
db68dd2780 docs update. 2014-10-15 21:39:33 +01:00
photonstorm
9140163c85 Fixed a reference error to the Loader.baseURL in Cache._resolveUrl method (thanks @neurofuzzy #1235) 2014-10-15 21:36:44 +01:00
photonstorm
4ac162216a readme updates. 2014-10-14 01:10:26 +01:00
photonstorm
3997a7c372 Time.prevTime is a new property that contains the raw value of the game timer from the previous update.
Timer.timeCap has been changed from `1000` to `1 / 60 * 1000` to bring it in line with Time.timeCap.
2014-10-13 16:18:42 +01:00
photonstorm
5d84f38f6e Device.canPlayAudio now supports the opus files directly, as well as opus encoded audio stored in ogg containers (#1232) 2014-10-13 13:52:41 +01:00
photonstorm
ac27f12c95 Fixes for Pixi update WebGL UV calls. 2014-10-11 04:18:42 +01:00
photonstorm
163a6c46f3 Updated to Pixi 2.0.0-dev. 2014-10-10 20:36:04 +01:00
photonstorm
022d7094d5 jsdoc fixes and frameRate change. 2014-10-10 14:49:01 +01:00
photonstorm
bee0e73748 Preparing for 2.1.3 dev. 2014-10-09 16:32:31 +01:00
photonstorm
9f24c08216 Updated readme and docs. 2014-10-09 16:12:53 +01:00
photonstorm
506a091257 Sound.allowMultiple allows you to have multiple instances of a single Sound playing at once. This is only useful when running under Web Audio, and we recommend you implement a local pooling system to not flood the sound channels. But it allows for one Sound object to play overlapping times, useful for gun effects and similar (#1220) 2014-10-09 14:44:25 +01:00
photonstorm
a2a60f207f Updated readme and TS defs. 2014-10-09 14:16:24 +01:00
photonstorm
94b6c01f31 readme updates. 2014-10-09 14:16:23 +01:00
photonstorm
b00866cee9 AnimationManager.name will now return the name property of the currently playing animation, if any. 2014-10-09 14:06:13 +01:00
Richard Davey
5dbe6b6017 The Uint32Array check used in Utils was incorrectly replacing Uint32Array on Safari, causing errors like BitmapData.getPixel32 to fail and other related issues (fixes #1043 and #1197) 2014-10-05 12:35:40 +01:00
photonstorm
ab78710daa BitmapData.textureLine takes a Phaser.Line object and an image in the image cache. It then accurately draws the image as a repeating texture for the full length of the line. 2014-10-03 02:21:09 +01:00
photonstorm
173786c60d Color.createColor now populates the color property of the returned object with the results of Phaser.Color.getColor.
Color.createColor now has a `color32` property with the results of `Phaser.Color.getColor32`.
Color.hexToColor has been optimised to inline the regex and has moved the createColor call so it now populates the color object fully, not just setting the r,g,b properties.
2014-10-01 16:51:34 +01:00
photonstorm
2794d94b08 Color.createColor now populates the color objects color and color32 properties with the results of Phaser.Color.getColor and getColor32 respectively. 2014-10-01 15:19:57 +01:00
photonstorm
d65c526184 Cache.addBitmapData has a new parameter: frameData allowing you to pass a Phaser.FrameData object along with the BitmapData.
Cache.getFrameData has a new parameter: `map` which allows you to specify which cache to get the FrameData from, i.e. `Phaser.Cache.IMAGE` or `Phaser.Cache.BITMAPDATA`.
Sprite.loadTexture if given a BitmapData as the texture will now query the cache to see if it has any associated FrameData, and if so it will load that into the AnimationManager.
2014-10-01 03:10:13 +01:00
photonstorm
26f9e05dca BitmapData.shadow(color, blur, x, y) provides a quick way to set all the relevant shadow settings, which are then be used in future draw calls. 2014-09-30 22:50:08 +01:00
photonstorm
ef85b8415d If you pass a tinted Sprite to BitmapData.draw or BitmapData.copy it will now draw the tinted version of the Sprite to the BitmapData and not the original texture. 2014-09-30 21:07:57 +01:00
photonstorm
c195998a1e Color.webToColor restored. Converts a CSS rgba color into a native color value. 2014-09-30 01:44:33 +01:00
photonstorm
ecfed2b311 AnimationParser is now using value instead of nodeValue when parsing atlas XML files, avoiding Chrome deprecation warnings (thanks @valtterip #1189) 2014-09-29 22:52:09 +01:00
photonstorm
ccc4e42e03 A Timer with a delay value that was a float and not an integer would not loop correctly. Timer delay values are now passed through Math.round to avoid this (thanks @osmanzeki #1196) 2014-09-29 22:15:41 +01:00
Richard Davey
acba9c4e14 Updated TypeScript defs. 2014-09-29 12:14:02 +01:00
photonstorm
415c7fe578 Added the sourceRect and maskRect parameters back into BitmapData.alphaMask as they were accidentally removed in 2.1 (thanks seejay92) 2014-09-25 15:30:03 +01:00
photonstorm
7f196a01e7 Text.addColor allows you to set specific colors within the Text. It works by taking a color value, which is a typical HTML string such as #ff0000 or rgb(255,0,0) and a position. The position value is the index of the character in the Text string to start applying this color to. Once set the color remains in use until either another color or the end of the string is encountered. For example if the Text was Photon Storm and you did Text.addColor('#ffff00', 6) it would color in the word Storm in yellow.
Text.clearColors resets any previously set colors from `Text.addColor`.
2014-09-24 17:10:02 +01:00
photonstorm
9e29a58d89 Sound.fadeOut(duration) will fade the Sound to a volume of zero over the duration given. At the end of the fade the Sound will be stopped and Sound.onFadeComplete dispatched.
Sound.fadeIn(duration, loop) will start the Sound playing, or restart it if already playing, set its volume to zero and then increase the volume over the duration given until it reaches 1. At the end of the fade the Sound.onFadeComplete event is dispatched.
2014-09-24 06:51:39 +01:00
photonstorm
dd74e3b0b4 Changing any of the Text properties such as font, lineSpacing and fontSize on a Text object that wasn't already on the display list would cause an updateTransform error. Parent is now checked first in all setters. 2014-09-24 01:10:36 +01:00