YsraelJMM
081f4188df
Resize SVG in the preload.
...
The third time's the charm.
this.load.svg (key, src, {width: number, height: number}).
2018-08-17 14:24:31 -05:00
James Simpson
1ac7c969ea
Don't set gl.clearColor when no clearBeforeRender
...
Unless I'm missing something, the `gl.clearColor` command is unnecessary when you have `this.config.clearBeforeRender` set to `false`. This simply moves that into the config check to eliminate an unused command in those situations.
2018-08-17 14:03:17 -05:00
YsraelJMM
fb414129f8
Resizing SVG in the preload (2)
...
this.load.svg(key, src, {width: number, height: number});
example: https://www.youtube.com/watch?v=Kd7pNjY-FLk
2018-08-17 13:50:23 -05:00
YsraelJMM
1816e529e1
Resizing of the SVG in the preload
...
One of the main qualities of SVG images, is its scalability, not being able to use this, is to reduce it to be a bit more image. An SVG file has an XML format, so it can be modified with the DOM.
In order to collaborate, I have put the option to modify the parameters of the SVG and in this way make it adaptable.
The modification gives the option of being able to choose the size in the preload to which you want to have the image before rasterizing it; And so avoid the subsequent scaling that will not have the same quality.
You can see the example here:
https://www.youtube.com/watch?v=Kd7pNjY-FLk
tested in version 3.11 It does not interfere with the original code.
2018-08-17 12:37:35 -05:00
Chris Andrew
f46bd2cacd
Fixed documentation for a Vector2 constructor parameter and its ZERO constant.
2018-08-17 00:18:26 +01:00
James Simpson
e4ccc8ec2d
Use correct frame name in pixel perfect hit test
...
`gameObject.frame.key` doesn't exist and was passing an undefined value to `getPixelAlpha`. This just changes it to the correct `gameObject.frame.name` value.
2018-08-16 12:23:10 -05:00
TadejZupancic
7992924aae
Wrong bounds/displayTextOrigin on BitmapText text change
...
updateDisplayOrigin needs current width and height, which are not recalculated if the _dirty is not set to true.
2018-08-14 12:15:59 +02:00
Aurélien DUSSAUGE
b14d920581
Replace DistanceBetween with DistanceSquared in closest() and furthest() functions (ArcadePhysics.js)
2018-08-13 21:59:58 +02:00
Eirik S Korsnes
fe748e9dc7
- wrote dot-notated config properties as seperate typedefs
...
- add some missing properties
2018-08-12 12:19:48 +02:00
iamchristopher
9ef5fde70e
Added previous value when changing value
2018-08-09 15:28:56 -04:00
Richard Davey
4bdb0de312
The Arcade Physics Body.speed
property is now set whenever you set the velocity via setVelocity
or setVelocityX
or setVelocityY
which stops the body velocity being reset to zero if useDamping
is enabled. Fix #3888
2018-08-08 17:31:22 +01:00
Richard Davey
fe2ddcf934
Updated jsdocs
2018-08-08 17:03:08 +01:00
Richard Davey
764de08ff4
Camera.ignore
can now take nested-arrays of Game Objects and also supports both Groups and Containers.
2018-08-08 16:46:14 +01:00
Richard Davey
84ef115c67
Remove un-used code
2018-08-08 15:01:41 +01:00
Richard Davey
25268d2a40
Recalc size on content change.
2018-08-08 15:01:29 +01:00
Richard Davey
353b7b5edd
RenderTexture destroy working. Fix #3901
2018-08-08 13:56:43 +01:00
Richard Davey
66afe973af
Trying mixins
2018-08-08 01:33:55 +01:00
Jonan Scheffler
7c525b00fa
Correct Konami code in createCombo documentation.
2018-08-07 14:25:48 -07:00
Christian Freitag
1909d73a0e
- Added initial type definitions for plugins property within game object
2018-08-07 21:38:28 +02:00
Richard Davey
3a4bfa679b
Added experimental Camera to Render Texture
2018-08-07 16:27:21 +01:00
Richard Davey
65d81ec426
Formatting
2018-08-07 16:26:22 +01:00
Richard Davey
50baa268e3
addBase64
will return intance for chaining
2018-08-07 16:26:15 +01:00
Richard Davey
8573e60273
No config, no update
2018-08-07 16:25:55 +01:00
Richard Davey
8a9cfdf83b
Added properties and methods to Scale Manager ready for integration
2018-08-07 16:25:45 +01:00
Richard Davey
9f98b4c438
Moved to beta 2
2018-08-07 11:20:00 +01:00
Richard Davey
2d91d4a26b
You can now access the Game instance directly from a Scene using this.game
2018-08-07 11:19:20 +01:00
Richard Davey
80dcb601c7
Added bots methods
2018-08-07 04:32:26 +01:00
Richard Davey
9399f32de0
FB API calls complete
2018-08-07 03:16:48 +01:00
Richard Davey
a499345369
Leaderboard objects added
2018-08-07 01:25:32 +01:00
Richard Davey
d415e2ff7f
Updated FB Plugin
2018-08-07 00:54:34 +01:00
Richard Davey
fcf5d20d7b
Disable culling if layer has non-1 scroll factor #3893
2018-08-06 22:22:32 +01:00
Richard Davey
d45c1c9d97
Updating FB API
2018-08-06 17:48:58 +01:00
Richard Davey
f9e498353d
Fixed lack of TempMatrix for Graphics generateTexture
2018-08-06 16:19:30 +01:00
Richard Davey
faeed47b5e
eslint fixes
2018-08-06 15:32:08 +01:00
Richard Davey
e3f5590fc3
Use var to cut down on bytes
2018-08-06 15:29:36 +01:00
Richard Davey
26cc84522d
The CanvasRenderer.BlitImage
function has been removed, as has the associated blitImage
property from the Canvas Renderer as they're no longer used.
2018-08-06 15:29:27 +01:00
Richard Davey
fbb67ac201
The CanvasRenderer.DrawImage
function has been removed, as has the associated drawImage
property from the Canvas Renderer as they're no longer used.
2018-08-06 15:24:51 +01:00
Richard Davey
702e738ffc
When a Static Tilemap Layer is generated in WebGL it will use the Cameras roundPixels
value to clamp the tile coordinates.
2018-08-06 14:16:36 +01:00
Richard Davey
50821c29ac
Updated jsdocs
2018-08-06 13:45:56 +01:00
Richard Davey
cb6a6d2394
Merge branch 'master' of https://github.com/photonstorm/phaser
2018-08-06 13:31:31 +01:00
Richard Davey
86965c28e4
The Tilemap Culling function now uses the Tilemap tile dimensions for its bounds calculations, instead of the layer tile sizes, as they two don't have to match and it's the underlying grid size that takes precedence when calculating visible tiles. Fix #3893
2018-08-06 13:31:27 +01:00
Richard Davey
e1f554b119
Merge pull request #3894 from mikewesthad/fix-collision-end-triggering-multiple-times
...
Fix `collisionEnd` triggering many times in Phaser's Matter.js copy
2018-08-06 11:48:31 +01:00
Richard Davey
7eda747230
Merge pull request #3891 from FelixNemis/retrofont-line-spacing
...
Add lineSpacing option to RetroFont Config
2018-08-06 11:46:05 +01:00
Michael Hadley
7675615b70
Update matter copy with bug fix from liabru/matter-js@4e04043fe0
2018-08-05 21:29:49 -05:00
Richard Davey
41c9f8b1e1
Docs update
2018-08-06 00:41:34 +01:00
Charles Burnham
6a1c677677
Add lineSpacing option to RetroFont Config
2018-08-04 12:52:27 -05:00
Richard Davey
9675c269e6
Split Camera up into BaseCamera, which Camera now extends.
2018-08-04 13:05:41 +01:00
Richard Davey
4deb8e49ad
eslint fixes
2018-08-03 19:37:42 +01:00
Richard Davey
6027e9ca5a
Render Textures can now be cropped. Added missing jsdocs.
2018-08-03 19:30:55 +01:00
Richard Davey
d5c558b8e4
Render Texture now uses unified drawing functions
2018-08-03 19:17:39 +01:00
Richard Davey
82251cd85b
Removed Matrix Stack. No longer needed.
2018-08-03 19:17:12 +01:00
Richard Davey
2ab24c49c4
Tile Sprites updated to use new internal canvas and support crop
2018-08-03 19:14:06 +01:00
Richard Davey
e91d95e107
Text updated to use proper texture frame and now supports crop
2018-08-03 19:07:12 +01:00
Richard Davey
177e47cb84
The Texture Manager has a new method called renameTexture
which will let you rename a texture, changing the key to the new one given. All existing Game Objects will still maintain their reference, even after a rename.
2018-08-03 19:03:52 +01:00
Richard Davey
708a857a26
SetTransform
is a new Canvas Renderer function that consolidates the process of preparing a Game Object for rendering, without actually rendering it. This is used internally by the Graphics and Bitmap Text classes.
2018-08-03 19:02:43 +01:00
Richard Davey
8ed749bcb1
Removed old scissor code
2018-08-03 18:57:03 +01:00
Richard Davey
ae46e11e35
Skip processing if no tiles
2018-08-03 18:56:52 +01:00
Richard Davey
e8e32ecf2c
Swap look-up for direct reference
2018-08-03 18:56:12 +01:00
Richard Davey
0a35275c1a
TransformMatrix.setToContext
is a new method that will set the values from the Matrix to the given Canvas Rendering Context using setTransform rather than transform.
2018-08-03 18:55:33 +01:00
Richard Davey
22bc6d2a86
The batchTexture
method in the Texture Tint Pipeline now supports cropped Game Objects and will adjust the drawn texture frame accordingly.
2018-08-03 18:54:48 +01:00
Richard Davey
ca68904953
The Canvas Renderer has a new batchSprite
method that consolidates the process of drawing a texture-based Game Object to the canvas. It processes the alpha, blend mode and matrix calculations in a single function and now is used by nearly all Game Object canvas renderers.
2018-08-03 18:53:50 +01:00
Richard Davey
921cc738d9
Render Textures now use the frame source to store the glTexture in, not locally.
2018-08-03 18:51:07 +01:00
Richard Davey
c98f5edc23
Added resetCropObject
method to cut down on duplicate code.
2018-08-03 18:50:36 +01:00
Richard Davey
b65cf0647b
New Crop Game Object component.
2018-08-03 18:49:10 +01:00
Richard Davey
8c842f67de
Phaser.Utils.String.UUID
will return an RFC4122 complaint UUID as a string. This is used internally to avoid cache key conflicts, but is exposed for your own use as well.
2018-08-03 18:47:27 +01:00
Richard Davey
fc0dc13930
Removed use of currentBlendMode
and currentAlpha
2018-08-03 01:53:51 +01:00
Richard Davey
9f44896a3f
The Blend Mode is now set directly in all Canvas Renderers without comparing it to what's stored in the Canvas Renderer. This fixes problems where the blend mode would be lost between two different Game Objects because they restored the context, but didn't update the renderer flag. Game Objects in Canvas can now mix and match blend modes across the display list.
2018-08-03 01:29:18 +01:00
Richard Davey
e0918df6b0
Canvas particle renderer now using same matrix math as webgl
2018-08-03 01:04:46 +01:00
Richard Davey
0a035353fa
lint fix
2018-08-03 01:04:25 +01:00
Richard Davey
70b234952a
Updated the canvas tilemap layer renderers to support parent matrix and tidied up the internal flow
2018-08-03 00:50:45 +01:00
Richard Davey
6ef7033b44
Added in parent matrix support and refactored the drawing
2018-08-03 00:42:27 +01:00
Richard Davey
31421ee00a
The CullTiles
updates from 3.11 didn't factor in the position of the Tilemap Layer to its bounds calculations, causing Static layers displayed out of the Camera viewport to never render in Canvas mode. The method has also been optimized further, with less divisions and less checks if culling is disabled.
2018-08-03 00:40:56 +01:00
Richard Davey
1b5f084640
Added jsdoc
2018-08-03 00:34:21 +01:00
Richard Davey
eff01adbc9
Added divide argument to the Snap methods.
2018-08-03 00:34:11 +01:00
Richard Davey
318cc87e59
Use proper matrix for static layer, so we can do fun things with Render Textures
2018-08-02 22:15:08 +01:00
Richard Davey
8135b687fb
Added all the missing cull methods and properties into the Static Tilemap Layer, which is used by the Canvas Renderer
2018-08-02 22:14:51 +01:00
Richard Davey
f1d3412c38
Corrected data types
2018-08-02 22:14:32 +01:00
Richard Davey
66f6f9abc1
Removed un-used matrix
2018-08-02 22:14:23 +01:00
Richard Davey
0967bfcab4
Should use currentContext, not gameContext
2018-08-02 17:59:30 +01:00
Richard Davey
217bfd2343
Sorting out frame access
2018-08-02 17:59:19 +01:00
Richard Davey
96509e4ca4
Tidying p
2018-08-02 17:59:11 +01:00
Richard Davey
2a8dbb0c42
Removed un-used vars
2018-08-02 17:33:01 +01:00
Richard Davey
9ccb594958
Fixed Graphics Canvas Renderer so it uses the matrix values properly.
2018-08-02 17:24:29 +01:00
Richard Davey
c4c8b9e6ea
Added copyToContext method
2018-08-02 17:23:52 +01:00
Richard Davey
674fc487ec
Added missing commands
2018-08-02 17:03:41 +01:00
Richard Davey
20b74e746a
Fixed parent order
2018-08-02 16:19:14 +01:00
Richard Davey
2a66e01577
Added source
property so we can purge TSs based on origin
2018-08-02 16:16:46 +01:00
Richard Davey
7965c7aae4
Removed un-needed files.
2018-08-02 15:59:29 +01:00
Richard Davey
51163e6d4e
If you set window.FORCE_WEBGL
or window.FORCE_CANVAS
in the window in which the Phaser game is loaded it will over-ride the renderer type setting in your game config, and force either WebGL or Canvas. This is handy for quickly testing the differences between renderers without having to do a new build each time.
2018-08-02 15:58:36 +01:00
Richard Davey
b83c8cf513
Merged all the functions into the single class and tidied up the naming.
2018-08-02 14:58:09 +01:00
Richard Davey
286f36cd1e
Added ability for the Canvas Renderer to change context.
2018-08-02 14:57:37 +01:00
Richard Davey
122e6cab8a
Fixed frame var
2018-08-02 12:35:26 +01:00
Richard Davey
affe47714f
Render Textures can now save themselves to the Texture Manager.
2018-08-02 12:35:17 +01:00
Richard Davey
7566236d9b
Added isRenderTexture
property.
2018-08-02 12:34:57 +01:00
Richard Davey
261cb79d0d
Added addRenderTexture
method.
2018-08-02 12:34:01 +01:00
Richard Davey
3efc800bf7
Use global string to cut down on size a little.
2018-08-02 12:33:48 +01:00
Richard Davey
72d54dd1ac
Only clear if dirty. Only render children is visible.
2018-08-01 20:25:55 +01:00
Richard Davey
c9e0963696
Added dirty fag
2018-08-01 20:25:40 +01:00
Richard Davey
a11b059531
Draw a whole Scene now!
2018-08-01 18:28:14 +01:00
Richard Davey
c9efa21cfd
Added getChildren to keep inline with Group
2018-08-01 18:28:06 +01:00