Commit graph

798 commits

Author SHA1 Message Date
Richard Davey
b629539176 SpriteBatch incorrectly applied the PIXI SpriteBatch prototype over the top of Phaser.Group meaning that Sprites with animations wouldn't render correctly (thanks @qdrj #1951) 2016-02-17 03:23:56 +00:00
Richard Davey
0c52b9316a Text with lineSpacing set wouldn't apply the lineSpacing to the final line of text in the Text string, or to text with just single lines. This could lead to incorrect height calculations for further layout and unwanted padding at the bottom of Text objects (thanks @Lopdo #2137) 2016-02-17 03:14:51 +00:00
photonstorm
5bcfa08af6 Text.useAdvancedWrap allows you to swap between the Basic and the Advanced word wrapping functions. In Advanced it will wrap long-words and condense and trim excess white space (thanks @soldoutactivist #1811) 2016-02-04 16:00:21 +00:00
Richard Davey
a4c5fb9660 BitmapData.drawGroup can now handle drawing Emitters and BitmapText objects that are part of the Group. 2016-02-03 23:08:54 +00:00
Richard Davey
10209dc8f5 GameObject.revive used to add the health amount given to the Game Object (via heal) instead of setting it as the new health amount. It now calls setHealth instead, giving it the exact amount (thanks @netgfx #2231)
GameObject.revive will now set the health amount to 100 instead of 1, bringing it in-line with the `maxHealth` default value.
2016-02-03 21:44:06 +00:00
Richard Davey
034428e92c Sprite (and all Game Objects) have a new argument in their destroy method: destroyTexture. This boolean (which is false by default) controls if the BaseTexture of the Game Object should be destroyed or not. This is extremely useful in situations where you've got a lot of dynamic assets you no longer need, such as textures created from BitmapDatas. You must set the destroyTexture argument yourself. This can be done in a custom Game Object destroy method or as part of your state shutdown (#2261) 2016-02-03 11:41:37 +00:00
Richard Davey
8043d29aa6 BitmapData would always create a private _swapCanvas which was a clone of its main canvas used for advanced movement operations. This no longer happens. The swap canvas is created only as needed, by those functions that use it (specifically moveH and moveV), meaning a BitmapData will now use half the amount of memory it used to, and you'll have half the amount of canvas DOM elements created (unless you make heavy use of the move functions). 2016-02-03 11:41:37 +00:00
Richard Davey
75d6bbb251 Updated defs and improved jsdocs for #2277 2016-02-02 23:37:08 +00:00
Richard Davey
d4edbe6619 Merge pull request #2277 from slashman/exposeWrappedLinesOnText
Alow precalculating the results of text wrapping.
2016-02-03 01:32:49 +02:00
Richard Davey
88f1ea95d2 Fixed BitmapText.cleanText so it works properly with new-lines within the text.
BitmapText would crash if it tried to render a character that didn't exist in the font set. Any character that doesn't exist in the font set now renders a space character instead.

BitmapText would load and parse the kerning data from the font, but would never use it when rendering. The kerning values are now applied on rendering as well (thanks @veu #2165)
2016-02-02 22:54:01 +00:00
Richard Davey
bceca55c8f Merge pull request #2222 from FracturedShader/patch-2
Update BitmapData.shiftHSL, limitValue -> clamp
2016-02-02 02:31:54 +02:00
Richard Davey
5893224f10 The Style object passed in to Phaser.Text is now cloned instead of referenced. This means you can adjust single Text instances without invaliding other Text objects using the same style object (thanks @asyncanup #2267) 2016-02-02 00:29:46 +00:00
Richard Davey
34aff350eb The Video game object used an anonymous bound function for both the 'ended' and 'playing' event listeners, meaning that they were never removed properly (thanks @ramalhovfc #2303) 2016-02-02 00:18:50 +00:00
Richard Davey
1d2d707b32 Merge pull request #2168 from nlotz/dev
fix typos in API docs
2016-02-01 19:01:58 +02:00
Richard Davey
e551254b52 Merge pull request #2209 from FracturedShader/patch-1
Update BitmapData.setHSL to accept 0
2016-02-01 18:57:29 +02:00
Richard Davey
76e2dc66ee Fixed docs (#2216) 2016-02-01 16:42:03 +00:00
Richard Davey
37d9b3402d Merge pull request #2226 from milkey-mouse/fix-retrofont-smoothed
Change RetroFont.smoothed from string to boolean
2016-02-01 18:32:22 +02:00
photonstorm
d7b6d4e784 jshint fix (missing semi-colon) 2016-01-13 16:15:46 +00:00
photonstorm
70437a0bdd Clean text automatically on creation. 2016-01-13 15:18:42 +00:00
photonstorm
6a868cba5e BitmapText.cleanText is a new method that will scan the given text and either remove or replace all characters that are not present in the font data. It is called automatically by BitmapText.updateText. 2016-01-13 15:15:51 +00:00
photonstorm
36d9c8d673 Changed from a space to '' and added 'replace' argument. 2016-01-13 15:14:14 +00:00
slash
5cc6b5962b Add missing assignations required for wrapping calculations to work
correctly
2016-01-03 16:54:27 -05:00
slash
ef7c2c6275 Alow precalculating the results of text wrapping. This may be useful for
example if the developer wants to control pagination, in which case
he may know in advance the total number of lines the text will wrap to,
and then set it on batches.
2016-01-03 16:33:33 -05:00
Robert Plante
8f1450ecca Update to BitmapData.setHSL to follow conventions 2015-11-23 12:46:12 -05:00
Milkey Mouse
19845eb691 Changed RetroFont.smoothed from string to boolean 2015-11-22 21:37:28 -08:00
Robert Plante
45195848bc Update BitmapData.shiftHSL, limitValue -> clamp
`math.limitValue` does not exist so it was changed to `math.clamp` which provides the desired functionality.
2015-11-17 15:34:42 -05:00
Robert Plante
e236cac1e6 Update setHSL
Checking `if (h)` yields `false` when `h = 0`, but 0 is an acceptable value here. Had to decide between caching HSL verification and doing `typeof` 3x/pixel and opted for the temporary variables.
2015-11-17 14:15:26 -05:00
photonstorm
609b38c6e1 BitmapData.update causes a snowballing memory leak under WebGL due to a Context.getImageData call. BitmapData.clear used to call update automatically but no longer does. This resolves the issue of the Debug class causing excessive memory build-up in Chrome. Firefox and IE were unaffected (thanks @kingjerod #2208) 2015-11-17 14:07:56 +00:00
photonstorm
1c169ef571 Video jsdoc fixes. 2015-11-02 11:51:15 +00:00
Richard Davey
799efa3079 You can use the new const Phaser.PENDING_ATLAS as the texture key for any sprite. Doing this then sets the key to be the frame argument (the frame is set to zero). This allows you to create sprites using load.image during development, and then change them to use a Texture Atlas later in development by simply searching your code for 'PENDING_ATLAS' and swapping it to be the key of the atlas data. 2015-10-31 01:04:14 +00:00
nlotz
da45d04a70 fix typos in API docs 2015-10-27 09:10:14 +01:00
photonstorm
efc69ff463 Buttons (or any Sprites) that don't have a texture, but have children, would incorrectly render the children under WebGL due to the baseTexture.skipRender property (thanks @puzzud #2141) 2015-10-16 16:44:51 +01:00
photonstorm
45d92d4217 ScaleMin and ScaleMax stopped working in Phaser 2.3.0 due to an incorrect transform callback scope (thanks @brianbunch #2132) 2015-10-13 13:32:55 +01:00
photonstorm
84373dc478 Removed use of the tilePosition property in the Phaser.Rope class as it isn't implemented and caused calls to Rope.reset to crash (thanks @spayton #2135) 2015-10-13 12:20:02 +01:00
Richard Davey
e097a1227e Merge pull request #2052 from nickryall/fix-for-text-centered-on-sprite
adjust wrapped text that is centered to sprite via anchor
2015-10-13 13:50:11 +03:00
photonstorm
e01a754732 Removed the FrameDebugger and moved to its own branch. 2015-10-12 11:10:37 +01:00
Richard Davey
8899eddd9a BitmapData.clear now automatically calls BitmapData.update at the end of it. 2015-09-29 14:02:26 +01:00
Richard Davey
5a275f14a8 Removing dead code. 2015-09-28 03:26:27 +01:00
photonstorm
de5283b989 The default Button.onOverMouseOnly value has changed from false to true. If you used this in your touch enabled games then please be aware of this change (#2083) 2015-09-22 15:24:52 +01:00
Richard Davey
9f08442304 Merge pull request #2103 from pnstickne/wip-2062
Fixes #2062 and forward-support for pointer modes
2015-09-22 17:14:32 +03:00
Paul
31e5202eff Fixes #2062 and forward-support for pointer modes
Impact:
  - *none for touch devices*
  - *low* / 'expected behavior' for mouse devices

Adds a PointerMode enumeration value for better simple input
discrimination in the future.

The added Button#justReleasedPreventsOver controls if a just-release event
on a pointer prevents it from being able to trigger an over event.

The default value is PointerMode.CONTACT which means this 'release guard'
applies only to touch inputs.

It should fix #2062 as Mouse (PointerMode.CURSOR) input is not caught in the default.

Also expands Button#forceOut to accept a PointerMode value such that it
can be controlled per-input mode.

This is a configurable partial revert of a possibly rogue commit in 2.1.3
and the behavior persists through 2.4.3.
2015-09-22 01:12:43 -07:00
Richard Davey
61edd1b458 FrameDebugger can now handle Text and BitmapText. 2015-09-16 03:18:15 +01:00
photonstorm
8db23545da jsdoc updates. 2015-09-10 15:57:55 +01:00
Richard Davey
d7a42370a4 BitmapData.move, moveH and moveV have a new optional wrap argument allowing you to control if the contents of the BitmapData are wrapped around the edges (true) or simply scrolled off (false). 2015-09-07 01:16:43 +01:00
photonstorm
8833a509eb jsdoc fix. 2015-09-02 16:16:52 +01:00
nickryall
ca795af457 adjust wrapped text that is centered to sprite via anchor 2015-09-02 10:50:03 +12:00
Richard Davey
41906c5ac1 When the Text width was being calculated it would add the strokeThickness value twice, causing an alignment offset (thanks @nickryall #2039) 2015-08-31 11:33:18 +01:00
Paul
26a6338072 Change splice.call(arguments, ..) to use slice
- Bypasses issue of usage incorrectly omitting 2nd argument to `splice`

- More clear of intent; `slice` does not modifify `arguments`

- `slice` is faster across all desktop browsers, by varying degrees
  - Probably due to parameter-aliasing and de-opts when modified.
  - Both `slice` and `splice` create a new Array object
2015-08-26 23:50:16 -07:00
Ben Sparks
b7efb93698 utilize the heal method instead of just adding to health when reviving, so that maxHealth is respected 2015-08-25 14:42:02 -07:00
photonstorm
4fa1ffb4cf JSDocs update. 2015-08-20 12:47:59 +01:00
Richard Davey
994a7dae73 jsdoc fix #2013 2015-08-19 22:19:55 +01:00
photonstorm
103c37cd42 BitmapData.drawFull draws the given Game Object or Group to a BitmapData and then recursively iterates through all of its children, including children of Game Objects and Groups. It can draw Text, BitmapText, Sprites, Images, Emitters and Graphics objects. It's perfectly valid to pass in game.world as the parent object, and it will iterate through the entire display list. 2015-08-19 14:19:26 +01:00
photonstorm
176289f514 Video.stop now removes the 'playing' event listener, which stop Videos set to loop from throwing errors after being destroyed. 2015-08-18 16:04:10 +01:00
photonstorm
b1a05a6f52 BitmapText.font failed to pull the new font from the Phaser Cache, stopping it from updating properly (thanks @AbrahamAlcaina #2001) 2015-08-18 13:48:08 +01:00
Richard Davey
7fbeb1c062 BitmapData.line draws a line to the BitmapData in the color and thickness specified.
Lots of BitmapData updates to use local vars and 'op' property, cutting down code size.
2015-08-07 02:48:00 +01:00
Richard Davey
62c87052cb Merge pull request #1985 from yahiko00/master
Extra documentation and TypeScript definition file update
2015-08-06 14:20:26 +01:00
Yahiko Uzumaki
0416c6a9ee Update BitmapData.js
Fix explanation.
2015-08-06 13:57:43 +02:00
yahiko
d412431947 Add extra information for the imageData property. 2015-08-06 13:49:51 +02:00
photonstorm
9a0b6c24a4 Text can now accept undefined or null as the text argument in the constructor and will cast it as an empty string. 2015-08-06 10:28:49 +01:00
Richard Davey
7fc23c9abe Text.setTextBounds didn't add the x and y values to the width and height offsets. 2015-08-04 23:06:07 +01:00
photonstorm
1fed360659 VideoStream.active = false is used if the browser supports it, otherwise it falls back to VideoStream.stop. 2015-08-04 15:48:43 +01:00
photonstorm
e901fb80f6 Merging in the CanvasPool changes to the core. 2015-08-03 14:46:55 +01:00
photonstorm
50516e3d34 Testing CanvasPool. 2015-08-03 14:33:12 +01:00
photonstorm
4e857f19f6 BitmapText with tints applied wouldn't update properly in Canvas mode (thanks @Pajamaman #1969) 2015-08-03 11:51:04 +01:00
Richard Davey
9362a2b1f4 Text with tints applied wouldn't update properly in Canvas mode. 2015-07-31 19:09:49 +01:00
Richard Davey
cbc68ab4c9 Merge pull request #1950 from jdnichollsc/dev
Added Text.addFontStyle and Text.addFontWeight
2015-07-31 16:00:47 +01:00
photonstorm
d23e5d6eba BitmapText.smoothed is a new boolean property that allows you to set texture smoothing on a bitmap font or not. By default smoothing is always on, but you can turn it off which helps for bitmap fonts created from pixel art style character sets. 2015-07-31 15:58:00 +01:00
photonstorm
4b22f48c75 2.4.2 release. 2015-07-29 15:01:04 +01:00
Juan David Nicholls Cardona
655013da1b Added Text.addFontStyle and Text.addFontWeight allows you to set styles and weights font within the Text. 2015-07-28 02:05:08 -05:00
photonstorm
9a83ddcab9 Updated to latest Creature runtimes, added to GameObjectFactory. 2015-07-23 13:25:08 +01:00
photonstorm
858ad51610 Phaser 2.4 release. 2015-07-22 15:31:30 +01:00
photonstorm
ffaa7d711f Removed BaseTextureCache requirement from BitmapData.
Fixed jshint.
Updated TS defs.
2015-07-22 13:23:40 +01:00
photonstorm
915a757f96 Text.updateText will now check the width and height values of the Text canvas and if either are zero it sets Text.renderable = false to avoid throwing WebGL texture binding errors. 2015-07-22 12:43:43 +01:00
photonstorm
f15fe6706c All undefined argument checks were changed from if (typeof x === 'undefined') to if (x === undefined) removing the typeof check and saving some bytes across the codebase in the process. 2015-07-22 10:37:15 +01:00
photonstorm
7144b10ad5 TileSprites fixed for WebGL. 2015-07-21 13:24:12 +01:00
Richard Davey
2d3b1ee383 Merge pull request #1911 from mthurlin/patch-1
game.make.group() did not setup parent correctly
2015-07-16 15:40:10 +01:00
Charlo
795a7c80a8 Improving JSON BitmapText implementation 2015-07-16 13:30:55 +02:00
Richard Davey
9c588d94e8 PIXI.BitmapText has been removed as a global array, as it is no longer used. 2015-07-16 01:29:32 +01:00
Richard Davey
3c7293ab57 Updated AnimationParser and fixed LoadTexture calls. 2015-07-16 01:02:59 +01:00
Richard Davey
bab50d7c88 * The Cache has been internally refactored considerably. Image data is now all stored in the same object, rather than being split across the PIXI global caches (such as PIXI.TextureCache and PIXI.BaseTextureCache), which are no longer used by Phaser.
* Internally the Cache now uses a single _cache object, which is partitioned to store the various different object types. Before the cache used lots of private objects, one per data type, but it's now a lot cleaner and we've managed to cut out hundreds of lines of duplicate code in the process.
* Cache.getImage has a new argument which lets you return either just the HTML Image element or the entire image cache object, which includes the baseTexture and frame data.
* Cache.getImage will return a __default image if the key isn't given, or a __missing image if the key is given but not found in the cache. This means it will always return a valid image and no longer cause Phaser to throw runtime errors deeper down with invalid image objects.
2015-07-16 00:46:28 +01:00
photonstorm
f52b553eaf Loads more Cache optimisations and tweaks. 2015-07-15 17:06:29 +01:00
photonstorm
81b553d8ee Ok let's start removing these 'typeof' checks. 2015-07-15 16:33:26 +01:00
photonstorm
d663d290c2 hasFrameData added and some LoadTexture updates. 2015-07-15 16:33:01 +01:00
Markus Thurlin
d360384f4a game.make.group() did not setup parent correctly 2015-07-15 14:30:28 +02:00
Richard Davey
4dec046c40 Added pendingDestroy to Groups. 2015-07-12 11:33:30 +01:00
photonstorm
5ad3698703 BitmapData.clear has 4 new optional parameters: x, y, width and height, that define the area to be cleared. If left undefined it works exactly the same as before and clears the entire canvas. 2015-07-09 11:44:21 +01:00
Richard Davey
d027bf8ba7 BitmapData.generateTexture will take a snapshot of the BitmapDatas canvas at that moment in time and convert it into an Image, which is then stored in the Phaser image Cache based on the key given. You can then use the new texture for any future sprites or texture based objects. 2015-07-09 00:19:07 +01:00
Richard Davey
7253ac368d jsdoc update. 2015-07-08 19:11:41 +01:00
Richard Davey
3590272c51 All Game Objects have a new boolean property called pendingDestroy. If you set this to true then the object will automatically destroy itself in the *next* logic update, rather than immediately. This is useful for cases when you wish to destroy an object from within one of its own callbacks, such as with buttons or other input events (thanks @alamboley #1748) 2015-07-08 18:52:01 +01:00
photonstorm
64b1794d67 Rope.segments used the wrong vertices property, causing a runtime error.
Debug.ropeSegments didn't take the scale of the Rope object into consideration, causing incorrect debug rendering.
2015-07-08 16:40:26 +01:00
photonstorm
47e1d16a6d jshint fix. 2015-07-08 16:00:03 +01:00
photonstorm
3012e49937 Text.addColor would incorrectly color the text stroke if set (thanks @llevkin #1893
Text.addStrokeColor works in the same way as `Text.addColor` but allows you to define a color stop for the stroke color instead of the fill color.
2015-07-08 12:52:39 +01:00
Richard Davey
86cac2085c BitmapData.move(x, y) allows you to shift the contents of the BitmapData horizontally and vertically by the given amounts. The image wraps-around the edges of the BitmapData.
BitmapData.moveH(distance) allows you to horizontally shift the BitmapData with wrap-around the edges.

BitmapData.moveV(distance) allows you to vertically shift the BitmapData with wrap-around the edges.
2015-07-08 04:26:28 +01:00
Richard Davey
a7e18137d1 Text has a new style property: tabs. This allows you to specify a pixel value (or values) that allows you to space out text that contains tab characters within it. Text.tabs can be either an integer, in which case all tabs share the same spacing, or an array of pixel values corresponding exactly to the number of tabs per line of text. This allows you to easily align columns of data in a single Text object. 2015-07-08 01:15:31 +01:00
Richard Davey
3066f60f11 parseList support added. 2015-07-08 00:03:03 +01:00
Richard Davey
2e447ec01d Tidied up tab handling a little. 2015-07-07 23:41:37 +01:00
Richard Davey
ae08b9ac02 Text tab support working. Now to add varying tab sizing. 2015-07-07 23:31:44 +01:00
Richard Davey
b8cc4d9d53 Updated Text resolution handling. 2015-07-07 20:48:00 +01:00
photonstorm
9548fb9856 Final textBounds updates. 2015-07-07 15:16:23 +01:00
photonstorm
a89d48b9a6 Text.autoRound allows you to control if the text is allowed to render at sub-pixel coordinates or not. Set to true to round the coordinates, often eliminating anti-aliasing from certain font types (#1867) 2015-07-02 13:39:59 +01:00
Richard Davey
2b7666e22d Added toString to the constructor parameter. 2015-07-01 23:37:48 +01:00
photonstorm
8356aacaa8 Trying out new Text pivot and mute handling. 2015-06-24 19:57:40 +01:00
photonstorm
a69c156526 The Text Bounds is a rectangular region that allows you to align your text within it, regardless of the number of lines of text or position within the world. For example in an 800x600 sized game if you set the textBounds to be 0,0,800,600 and text alignment to 'left' and vertical alignment to 'bottom' then the text will render in the bottom-right hand corner of the game, regardless of the size of font you're using or the number of lines in the text itself.
Set the Style properties `boundsAlignH` and `boundsAlignV` or adjust them via the Text setters to change the alignment.

It works by calculating the final position based on the Text.canvas size, which is modified as the text is updated. Some fonts have additional padding around them which you can mitigate by tweaking the Text.padding property.

Setting a textBounds _doesn't_ update the wordWrapWidth, so be aware of the relationship between the two.

Call this method with nothing defined for any of the parameters to reset an existing textBounds.

#1824
2015-06-17 17:18:04 +01:00
photonstorm
0258245f12 Phaser.Text no longer extends PIXI.Text but replaces it entirely. Phaser.Text now natively extends a Phaser Sprite, meaning it can be enabled for physics, damaged, etc. 2015-06-17 13:21:28 +01:00
photonstorm
102c74e121 Deprecated the following:
* Camera.screenView
* ScaleManager.maxIterations
* ScaleManager.enterPortrait (see onOrientationChange)
* ScaleManager.enterLandscape (see onOrientationChange)
* ScaleManager.enterFullScreen (see onFullScreenChange)
* ScaleManager.leaveFullScreen (see onFullScreenChange)
* ScaleManager.fullScreenFailed (see onFullScreenError)
* ScaleManager.checkResize
* ScaleManager.checkOrientation
* ScaleManager.setScreenSize (see updateLayout)
* ScaleManager.setSize (see reflowCanvas)
* ScaleManager.checkOrientationState (see reflowCanvas)
* ScaleManager.orientation (see screenOrientation)
* Gamepad.disabled (see enabled)
* Input.currentPointers (see totalActivePointers)
* Input.disabled (see enabled)
* Keyboard.disabled (see enabled)
* Mouse.disabled (see enabled)
* Mouse.mouseMoveCallback (see Input.addMoveCallback)
* MSPointer.disabled (see enabled)
* Touch.disabled (see enabled)
* Cache.getUrl (see getURL)
* Math.truncate (see Math.trunc)
* Math.snapToInArray (see Phaser.ArrayUtils.findClosest)
* Math.interpolateFloat (see Math.linear)
* Math.normalizeLatitude (use Phaser.Math.clamp(lat, -90, 90))
* Math.normalizeLongitude (use Phaser.Math.wrap(lng, -180, 180))
* Math.chanceRoll (use Phaser.Utils.chanceRoll)
* Math.numberArray (use Phaser.ArrayUtils.numberArray)
* Math.numberArrayStep (use Phaser.ArrayUtils.numberArrayStep)
* Math.limitValue (use Phaser.Math.clamp)
* Math.randomSign (use Phaser.Utils.randomChoice(-1, 1))
* Math.angleLimit (use Phaser.Math.clamp)
* Math.getRandom (use Phaser.ArrayUtils.getRandomItem)
* Math.removeRandom (use Phaser.ArrayUtils.removeRandomItem)
* Math.floor (use Math.trunc)
* Math.ceil (use Phaser.Math.roundAwayFromZero)
* Math.shift (use Phaser.ArrayUtils.rotate)
* Math.shuffleArray (use Phaser.ArrayUtils.shuffle)
* Math.distanceRounded (do the rounding locally)
* Canvas.getOffset (see Phaser.DOM.getOffset)
* Canvas.getAspectRatio (see Phaser.DOM.getAspectRatio)
* TilemapLayer.tileColor (use TilemapLayer.debugSettings.missingImageFill)
* Phaser.ArrayList alias removed, now use Phaser.ArraySet
* Utils.transposeArray (see Phaser.ArrayUtils.transposeMatrix)
* Utils.rotateArray (see Phaser.ArrayUtils.rotateMatrix)
* Utils.shuffle (see Phaser.ArrayUtils.shuffle)
2015-06-17 03:14:31 +01:00
photonstorm
8cf28fede7 maxHealth is a new property that Game Objects with the Health component receive and works in combination with the heal method to ensure a health limit cap. 2015-06-17 02:00:04 +01:00
photonstorm
b725c25702 Button game objects now have Input.useHandCursor set to true by default. 2015-06-17 01:55:36 +01:00
Richard Davey
0b82a68717 Merge pull request #1794 from stephandesouza/patch-1
Add a Heal Method to Phaser.Components.Health
2015-06-17 01:54:14 +01:00
Richard Davey
a7a74550a5 Merge pull request #1837 from Feenposhleen/dev
JSON support for BitmapFont atlases
2015-06-17 01:49:23 +01:00
photonstorm
40802314dd TileSprite now fully supports animation again, having been broken for several versions due to a Pixi upgrade. We've updated the way TileSprites generate their textures internally considerably and animation support is back across both Canvas and WebGL as a result (#1653) 2015-06-17 01:25:56 +01:00
photonstorm
d931cedb69 Fixed issue with long text dropping to be shorter again. 2015-06-16 12:45:26 +01:00
photonstorm
70cf7a32bc Fixed jshint errors. 2015-06-13 02:31:21 +01:00
photonstorm
f216313582 jsdoc and debug removal. 2015-06-12 19:21:06 +01:00
photonstorm
fa469b85e1 Added GameObjectFactory.video url parameter. 2015-06-12 19:20:50 +01:00
photonstorm
10a3df1ef5 Set the Video baseTexture to __default until the stream starts. 2015-06-10 14:21:58 +01:00
photonstorm
5458097006 Renamed createVideoStream to startMediaStream.
Refactored Video constructor significantly - you can no longer create a webcam stream from the constructor, as it doesn't give you time to respond to onAccess and onError signals in Firefox. Instead call startMediaStream directly having set-up your signal listeners first.

startMediaStream now has a chance to dispatch the onError signal if the webcam has been blocked entirely by the browser (auto-block or remembered block). autoPlay attribute removed to stop Firefox throwing a "Invalid URI. Load of media resource failed" error.

Tidied up Video.destroy to properly remove video element from the DOM.
2015-06-10 00:59:24 +01:00
Charlo
17a8116382 Added JSON support for BitmapFont 2015-06-06 12:35:08 +02:00
photonstorm
2b0abb67dd onDragUpdate is a new signal that is dispatched whenever a Game object enabled for input and drag is moved by a pointer (i.e. during a drag event). See the Phaser.InputHandler.enableDrag docs for parameter details and the new Phaser Example. 2015-06-04 20:58:00 +01:00
photonstorm
a971928bbc jshint fixes. 2015-06-03 13:22:29 +01:00
photonstorm
560fed484f Added BitmapText.purgeGlyphs method. 2015-06-03 05:28:24 +01:00
photonstorm
03a7b6a708 Updated Destroy component to deal with BitmapText glyphs pool. 2015-06-03 05:28:24 +01:00
photonstorm
5e265bbe86 Re-ordered carriage-return detection. 2015-06-03 05:28:24 +01:00
photonstorm
90d08fbf24 Updated jsdocs and added align parameter to method call. 2015-06-03 05:28:24 +01:00
photonstorm
fa7259fd75 Removed debug calls. 2015-06-03 05:28:24 +01:00
photonstorm
2484ced06d Typo. 2015-06-03 05:28:24 +01:00
photonstorm
cf5238c749 Removed use of PIXI.BitmapText entirely. Moved all update and support functions to Phaser. 2015-06-03 05:28:23 +01:00
photonstorm
5054344668 The LoadTexture component has a new property: customRender which is checked for in the Core postUpdate to know when to render custom elements like Videos. 2015-05-21 15:24:39 +01:00
Gionatan Iasio
1bbb3bb903 Fix Rope.js
Rope creation key parameter didn't work, because PIXI.Rope requires a texture, not string.
Changed it like Sprite.
2015-05-16 19:59:12 +02:00
photonstorm
f78a4cb337 jshint fixes. 2015-05-15 01:35:20 +01:00
photonstorm
f725ac48ae Removed all the debug information. 2015-05-15 01:27:42 +01:00
photonstorm
f2e2039009 Invalidate the texture while we wait for the new one to load (crashes IE11 otherwise) 2015-05-15 01:17:44 +01:00
photonstorm
ce27da362b Stacks of fixes to the video stream support to get it working in Firefox. 2015-05-14 23:23:38 +01:00
photonstorm
aabeccbdac Working but needs refining. 2015-05-14 19:10:36 +01:00
photonstorm
63887faffe Loads of changes to deal with invalid textures and videos pending playback (i.e. Firefox) 2015-05-14 16:52:09 +01:00
photonstorm
ad4cf34d05 LoadTexture remembers texture valid state. 2015-05-14 16:52:09 +01:00
Stephan de Souza
cb89b9c293 Missed comma 2015-05-14 10:04:37 -03:00
Stephan de Souza
7fb555e70e Adds Heal Method to Phaser.Components.Health
Ideal when used in games with health packs, bonus items, or healing sprites.

In fact: Doing a negative damage causes the same effect, but as a new method is better for documentation.
2015-05-13 16:55:17 -03:00
photonstorm
e6f71e959a Graphics constructor now sets x/y parameters to zero if undefined. Before it would set them to undefined as the type check wasn't strict. 2015-05-12 13:03:26 +01:00
photonstorm
4aa22e22a1 Check texture property. 2015-05-12 13:03:26 +01:00
photonstorm
a1102d4d4d Added re-tint reset. 2015-05-08 04:12:20 +01:00
photonstorm
2cd59bbf32 Tidying up docs and formatting. 2015-05-08 04:12:07 +01:00
photonstorm
6f351ff0c1 Texture.requiresReTint is a new property that controls if a texture requires the display object to be re-tinted having been updated internally. The LoadTexture component now sets this. 2015-05-08 04:11:48 +01:00
photonstorm
164039d7e7 Sets the re-tint state to true.
Removed un-needed clear call.
2015-05-08 04:10:39 +01:00
photonstorm
326cb759cf Docs fixes. 2015-05-08 02:28:46 +01:00
photonstorm
855831e4c2 BitmapData.update now validates the width and height values to ensure they aren't lower than 1, which would previously cause a context error. 2015-05-08 01:49:59 +01:00
photonstorm
d2b9bfe7b8 RetroFont has been updated to use RenderTexture.renderXY, removing the need for creating a Point object each update.
RetroFont no longer puts any entries into the TextureCache or generates any UUIDs on instantiation, speeding up creation and lowering memory use.
2015-05-08 01:49:11 +01:00
photonstorm
e3b8fe3401 Proper setFrame call. 2015-05-07 02:45:33 +01:00
photonstorm
67704d0136 Updated Frame handling for Videos so sprites have their own frames, not a reference to the Videos frame. 2015-05-07 02:44:48 +01:00
photonstorm
af66b49f31 If a BitmapData is created with a width or height set to zero then the width and/or height are set to a default value (256) instead to avoid getContext errors. 2015-05-06 16:50:10 +01:00
photonstorm
303929a3ce Added Video.snapshot and Video.grab support. 2015-05-06 16:47:46 +01:00