Commit graph

556 commits

Author SHA1 Message Date
Richard Davey
3a3ad562ab Added generateFrameNames method and reduced in size.
Fixed Pad bug.
Fixed Animation framerate delta speed.
2017-04-05 04:18:08 +01:00
Richard Davey
4dae85e27c Animation repeat and yoyo now working properly. 2017-04-05 03:22:54 +01:00
Richard Davey
336ea77587 Fixed GO extends. 2017-04-05 02:10:48 +01:00
Richard Davey
701c4b317f Animation repeat and yoyo support. 2017-04-05 02:06:28 +01:00
Richard Davey
101e4f5be5 Animations working :) 2017-04-05 01:15:53 +01:00
Richard Davey
0ed1de6546 Lots of work updating the Animation system. 2017-04-04 23:59:37 +01:00
Richard Davey
ea0af28983 Default preUpdate function. 2017-04-04 23:59:27 +01:00
Richard Davey
b5e8e183b8 Animation Component added. 2017-04-04 23:59:16 +01:00
Richard Davey
86d048b079 Lots of tidying up + preUpdate call added back in. 2017-04-04 23:59:02 +01:00
Richard Davey
05bbfd9bd8 Animation Manager boot state call. 2017-04-04 23:58:45 +01:00
Richard Davey
8ec9061b43 Removed 'group' / 'parent' argument and forced to the State children component. You should use 'make' if you wish to add elsewhere. 2017-04-04 23:58:33 +01:00
Richard Davey
f79dcd0a07 Removed debug code. 2017-04-04 23:57:44 +01:00
Richard Davey
96a7811df7 jshint fixes 2017-04-04 23:57:37 +01:00
Richard Davey
7157d577f5 Updated GetFrames 2017-04-04 16:50:28 +01:00
Richard Davey
679dd1091e Lots more work on the Animation Manager. New Animation format defined, properties added, frame splitter added and starting to plan out update loop. 2017-04-04 16:32:33 +01:00
Richard Davey
acea677424 Added ability to load HTML files into textures. 2017-04-04 14:54:22 +01:00
Richard Davey
6f115a60e3 Added ability for the Loader to handle loading SVG files and creating Images from them (for use as Sprite textures) 2017-04-04 02:54:27 +01:00
Richard Davey
9c3ce047b8 Fixed typo in RectToTriangle and added in easy bounding box escape checks. 2017-04-04 01:22:23 +01:00
Richard Davey
3c12e15054 Added Rectangle to Triangle, and Triangle to Triangle intersection functions. Detects for face intersection and also point within point (so a triangle fully enclosed inside a rectangle for example) 2017-04-04 01:04:05 +01:00
Richard Davey
4914895509 Added Triangle and Rectangle decomposition functions to convert them into an array of points. 2017-04-04 01:03:28 +01:00
Richard Davey
895f7b054a Updated ContainsArray to include the returnFirst argument. 2017-04-04 01:02:56 +01:00
Richard Davey
b7c895c862 Added Triangle.CenterOn to place a triangle on an xy coord. 2017-04-04 01:02:41 +01:00
Richard Davey
4ec898aaa9 Added Phaser.Geom.Triangle.BuildFromPolygon to convert polygon into triangle objects.
Added latest build of Earcut (unminified + license)
2017-04-03 23:30:14 +01:00
Richard Davey
dcab0e1e18 Added Triangle.ContainsArray method, which is an optimized method of checking a whole array of points to see if they lie within a triangle. 2017-03-31 04:58:28 +01:00
Richard Davey
3d323836be Added Line.getPointA and getPointB methods. 2017-03-31 04:58:03 +01:00
Richard Davey
3618214331 Added TriangleToLine intersection test (based on the new LineToLine method) 2017-03-31 04:57:49 +01:00
Richard Davey
a2ba500cbe Changed the LineToLine intersection method to use the version created by Paul Bourke (smaller, faster, simpler). 2017-03-31 04:33:51 +01:00
Richard Davey
e6c431bfed Added Triangle to Circle intersection method. 2017-03-31 03:09:06 +01:00
Richard Davey
bda50e9d27 Added Triangle.getLineA, B and C because we're using those so often in various methods it just makes sense. 2017-03-31 03:08:54 +01:00
Richard Davey
08d0398f52 Fixed Graphics.strokeLineShape 2017-03-31 02:34:43 +01:00
Richard Davey
d3830445cc Added Triangle left, right, top and bottom setters. 2017-03-31 02:34:32 +01:00
Richard Davey
d61bcad272 Added LineToCircle intersection method. 2017-03-31 02:34:13 +01:00
Richard Davey
7bcdf669b8 Added Line.Offset, Triangle.Offset and Triangle.Equals. 2017-03-31 01:40:38 +01:00
Richard Davey
b3bced081a Added Triangle.Random to get a uniformly distributed point from within a Triangle.
Added RandomTriangle Action.
2017-03-31 01:21:55 +01:00
Richard Davey
e8b039af36 Added PlaceOnTriangle Action. 2017-03-31 00:46:27 +01:00
Felipe Alfonso
4228a5b634 Fixed rendering issue with arc command 2017-03-30 10:06:35 -03:00
Felipe Alfonso
98349a08b8 Fixed text rendering issue 2017-03-30 09:48:24 -03:00
Richard Davey
168ce84a01 GameObject.destroy calls Children.remove. 2017-03-30 13:28:40 +01:00
Richard Davey
c07ef79824 New Triangle methods: BuildRight, BuildEquilateral, Clone, CopyFrom, Rotate, RotateAroundPoint and RotateAroundXY. 2017-03-30 13:19:31 +01:00
Richard Davey
12e075ad10 Added Triangle.Area, Triangle.CircumCenter and Triangle.CircumCircle methods, as they're all really useful when dealing with Triangles. 2017-03-30 02:40:23 +01:00
Richard Davey
dc115121c4 Added Triangle.Centroid and Triangle.InCenter methods for determining the centers of a Triangle shape. 2017-03-30 01:51:18 +01:00
Richard Davey
47e6cff967 Added Graphics.fillPoint, fillPointShape and lineBetween methods. 2017-03-30 01:47:15 +01:00
Richard Davey
709819d601 Fixed triangle properties. 2017-03-30 00:45:17 +01:00
Richard Davey
a8308698bb Added Triangle geometry, and Triangle.contains and containsPoint methods. 2017-03-30 00:45:17 +01:00
Richard Davey
7ef33d005b Added ability to pass Geometry directly to the Graphics methods. 2017-03-30 00:45:17 +01:00
Felipe Alfonso
0fedb3b390 Fixed RGB and alpa per point on a path 2017-03-29 20:44:07 -03:00
Richard Davey
dccda7a5b3 PlaceOnRectangle now uses MarchingAnts and has a new shift argument. 2017-03-29 20:27:36 +01:00
Richard Davey
081b2816ce Added option to have step or quantity in MarchingAnts method. 2017-03-29 19:53:14 +01:00
Richard Davey
8664c278f1 PlaceOnRectangle Action added (using PerimeterPoint at the moment, but will swap to MarchingAnts). 2017-03-29 17:11:26 +01:00
Richard Davey
e612b2c0f4 Added Rectangle.MarchingAnts method. 2017-03-29 17:10:56 +01:00
Richard Davey
3b79c2cf52 Added default lineStyle alpha value. 2017-03-29 16:05:05 +01:00
Richard Davey
bf695ee6d1 Added PlaceOnCircle and PlaceOnLine Actions. 2017-03-29 16:04:51 +01:00
Richard Davey
18fa6292a6 Graphics objects now just take a config object, not a position.
Graphics objects can set default stroke and fill styles, which are re-applied after a clear.
2017-03-29 15:06:06 +01:00
Richard Davey
b3b495e53c Added Rectangle.PerimeterPoint method for getting the point on the perimeter of a rectangle based on the given angle. 2017-03-29 15:05:29 +01:00
Richard Davey
032f6e7084 Added Rectangle.centerX and centerY. 2017-03-29 15:05:06 +01:00
Richard Davey
d774757c06 Preparing for centerX/Y options. 2017-03-29 01:47:17 +01:00
Richard Davey
7f72c7b8ca GridAlign now takes a config object, and works with optional x/y settings too. 2017-03-29 01:34:46 +01:00
Richard Davey
2cfa57e35c Added offsetX/Y to AlignIn proxy. 2017-03-29 01:22:15 +01:00
Richard Davey
e69155662d Layer.createMultiple can now take an array of config objects. 2017-03-29 01:12:14 +01:00
Richard Davey
5c0f550072 Added step value to Rotate Action. 2017-03-29 01:03:24 +01:00
Richard Davey
b464aa5c8f Added SetScale createMultiple action. 2017-03-29 00:44:08 +01:00
Richard Davey
eaea6a7509 Fixed SetScale ternary. 2017-03-29 00:43:55 +01:00
Richard Davey
12499c1dfe Added SetOrigin Action. 2017-03-29 00:12:33 +01:00
Richard Davey
664b154e02 Fixed Layer.add return result. Updated createMultiple so that the setXY etc options are only applied to the newly created entities. 2017-03-29 00:09:16 +01:00
Richard Davey
93d7ed30fc Saved some space by using pngPrefix. 2017-03-28 23:56:00 +01:00
Richard Davey
7d18c891eb Fixed bug where it would corrupt the value of a dot notation config didn't contain a property. 2017-03-28 23:55:51 +01:00
Richard Davey
06fdb8c430 Layer.createMultiple now uses a config object and Array Range internally for far more complex options. 2017-03-28 23:38:14 +01:00
Richard Davey
6c4152c33d Added Array.Range - which allows for complex ranges of 2 arrays. 2017-03-28 23:38:14 +01:00
Felipe Alfonso
3e8e6141c8 Added render pass component to renderable game objects 2017-03-28 15:16:02 -03:00
Felipe Alfonso
439575adda RenderPass component 2017-03-28 15:00:16 -03:00
Richard Davey
76b6fc0d55 Added Call Action, and added inc property to all Spread actions. 2017-03-28 16:05:01 +01:00
Richard Davey
59c8e35b08 Added Spread, SmoothStep and SmootherStep Actions. 2017-03-28 15:33:25 +01:00
Felipe Alfonso
a1b6978b8e Sprite Batch now handles alpha 2017-03-28 11:20:53 -03:00
Richard Davey
ae18f7ebf2 Added Random Actions. 2017-03-28 14:57:42 +01:00
Richard Davey
304dfe3318 If source undefined return default 2017-03-28 14:57:34 +01:00
Richard Davey
3c423b5b7d Added Scale Actions. 2017-03-28 14:30:43 +01:00
Richard Davey
358b74237a Added Alpha Actions. 2017-03-28 14:01:35 +01:00
Richard Davey
93d9e97fa6 Split the Layer Actions out into their own namespace, because they can now be used from anywhere (just pass in an array of Game Objects). Renamed Align to GridAlign. Added step argument to SetX/Y/Rotation. 2017-03-28 13:20:39 +01:00
Richard Davey
81aa09d732 Added Layer actions for create, createMultiple, rotation around a fixed point, rotation by distance, and positioning around a circle. 2017-03-28 03:09:59 +01:00
Richard Davey
9268fcb586 Renamed addX to incX (etc) in Layer to avoid clashing with the addition of children. 2017-03-28 00:05:08 +01:00
Richard Davey
ab99951e2e Removed logs. 2017-03-27 23:53:29 +01:00
Richard Davey
fb9cc95229 Added setFlip methods. 2017-03-27 23:53:22 +01:00
Richard Davey
b4e9a4baed Align uses a Zone instead of a Rect. 2017-03-27 23:38:45 +01:00
Richard Davey
4158196f73 Sprite Sheets now add __BASE entry. 2017-03-27 23:38:34 +01:00
Richard Davey
fa61e4b11d Set a default frame for sprite sheets and atlases. 2017-03-27 23:38:27 +01:00
Richard Davey
92beff3555 Added Align Layer action. 2017-03-27 23:10:11 +01:00
Richard Davey
db55c4c6a1 Added new Zone game object. 2017-03-27 23:10:04 +01:00
Richard Davey
6d6af08cae Fixed all the bounds methods to use origin instead of anchor. 2017-03-27 23:09:54 +01:00
Richard Davey
91f3861ad7 Adding layer alignment. 2017-03-27 17:34:49 +01:00
Richard Davey
36c626b847 Refactored Layer to use a Set, and split all of its functions out into modules. 2017-03-27 16:59:58 +01:00
Richard Davey
ec72d18145 Fixed issue in Set. 2017-03-27 16:59:58 +01:00
Felipe Alfonso
cbbe3b78d4 Fixed z property on Transform 2017-03-24 11:49:54 -03:00
Richard Davey
72f12a1e79 Add.Existing. 2017-03-24 04:33:40 +00:00
Felipe Alfonso
9217012b79 state;s children depth sorting 2017-03-23 16:51:02 -03:00
Richard Davey
4684d23e16 Linting fixes. 2017-03-23 00:07:41 +00:00
Richard Davey
f125f35763 Added in all the missing Map functions, ready for use. 2017-03-22 23:44:55 +00:00
Felipe Alfonso
69a34df0ab Layer refactoring 2017-03-22 20:16:44 -03:00
Richard Davey
657ea7ffa7 AM start 2017-03-22 12:38:33 +00:00
Richard Davey
006d0b853f Small bit of tidying up. 2017-03-21 23:14:25 +00:00
Richard Davey
6fcd09c3bc RTL boolean. 2017-03-21 21:08:30 +00:00
Felipe Alfonso
84bc90f7ba Moved canvas to texture on Text to TExtWebGLRenderer 2017-03-21 18:06:36 -03:00
Felipe Alfonso
58e4912633 Moved uploadCanvasToGPU to WebGLRenderer 2017-03-21 17:45:57 -03:00
Felipe Alfonso
0cdb150357 Text rendering via canvas/texture upload 2017-03-21 17:08:43 -03:00
Felipe Alfonso
29ec16fd33 Flip component added to Bob, Image, Sprite and Text 2017-03-20 20:37:17 -03:00
Richard Davey
e28d4f7a47 Added origin + removed redundant module. 2017-03-20 19:10:44 +00:00
photonstorm
808e53f645 Fixed order of shadow fills. 2017-03-20 16:48:04 +00:00
photonstorm
741b93dbfe Fixed parent issues with TextStyle, and moved methods into Text for ease of access. 2017-03-20 16:28:09 +00:00
photonstorm
a87f1ca88b TextStyle is now responsible for MeasureText and caches the results.
Lots of new TextStyle methods.
TextStyle methods return the Text object itself, so you can chain easily.
Fixed Width and Height options added.
2017-03-20 16:09:01 +00:00
Richard Davey
7a6b643e99 Make Graphics methods chainable. 2017-03-19 23:07:41 +00:00
Richard Davey
2cc498e15e Updating sync methods. 2017-03-17 00:16:20 +00:00
Richard Davey
08d9e55066 Added Style set methods and moved shadow sync. 2017-03-16 21:59:50 +00:00
photonstorm
b5258b55b1 Quick todo 2017-03-16 17:16:32 +00:00
photonstorm
aa080cfe7b Updating TextStyle component to allow for setters and more style options. 2017-03-16 17:15:58 +00:00
photonstorm
4838b9da1d Added setDisplayOrigin. Added Math.round to updateOrigin to keep it pixel bound. 2017-03-16 15:37:43 +00:00
Richard Davey
be05610d3b Removed redundant render vars and Origin method. 2017-03-15 23:44:39 +00:00
Richard Davey
22154d905d Updated originX/Y to use a normalized value between 0 and 1. Added the properties displayOriginX and displayOriginY (read only) to hold the calculated pixel values. Updated renderers to use these values. 2017-03-15 23:08:59 +00:00
Felipe Alfonso
d0de931c93 per point coloring for line rendering 2017-03-15 16:23:10 -03:00
Felipe Alfonso
fd71283e1d fixed issue with canvas draw image and camera scroll 2017-03-15 14:25:52 -03:00
Richard Davey
607e62448b Added in the Text Game Object, splitting all of its common functions up. Working and rendering in Canvas mode. 2017-03-15 01:08:04 +00:00
Felipe Alfonso
400b18b5ce Fixed bug on ShapeBatch with corner wrapping to the first element. Also added lineWidthTo and moveWidthTo allowing easy creation of trails 2017-03-14 19:13:31 -03:00
photonstorm
16517ce898 Create Function.call to apply the scope 2017-03-14 17:00:14 +00:00
photonstorm
4832c65666 Added createCanvas method to the Texture Manager. 2017-03-14 16:37:32 +00:00
Richard Davey
bf19d3dee4 Starting on Text 2017-03-13 23:38:48 +00:00
Felipe Alfonso
130988d93e camera follow 2017-03-13 15:17:14 -03:00
Richard Davey
1bad881139 Swapped Transform undefined style. 2017-03-09 00:41:21 +00:00
Richard Davey
e887a3a6e8 Merged in Matter.js 2017-03-08 23:53:58 +00:00
Felipe Alfonso
7eeb8d5d30 transform checks for setter functions also removed old bitmap text 2017-03-08 20:49:44 -03:00
Richard Davey
9353b049aa Export correct color values. 2017-03-08 22:50:00 +00:00
Felipe Alfonso
29cd04121d Added dynamic and static bitmap text 2017-03-08 19:36:53 -03:00
Richard Davey
3300eb77d0 Fixed Graphics lineAlpha in Canvas Renderer. 2017-03-08 22:08:20 +00:00
Richard Davey
1ee3751eab Included color in HSV output. 2017-03-08 22:06:47 +00:00
Felipe Alfonso
b8f0b3357d Added fillTriangle and strokeTriangle to Graphics Game Object 2017-03-07 21:51:09 -03:00
Felipe Alfonso
2966c687e8 camera origin 2017-03-07 18:28:43 -03:00
Felipe Alfonso
9ed1216ad6 line rendering 2017-03-07 01:29:51 -03:00
Felipe Alfonso
d6f07973b2 Fixed transform issue when dealing with camera transforms 2017-03-06 15:13:39 -03:00
Felipe Alfonso
7dc2feace3 work in progress fix camera for transformed batch renderers 2017-03-03 18:28:04 -03:00
Richard Davey
d034f2381f Tided up the renderer, optimized ParseXML a load, removed dead files. 2017-03-03 01:41:33 +00:00
Richard Davey
6fa10a3e10 Finally :) 2017-03-03 00:22:29 +00:00
Richard Davey
844f113bbb Bounds working on unscaled Text. 2017-03-02 23:56:05 +00:00
Richard Davey
61aafe5be9 More tweaking 2017-03-02 23:39:52 +00:00
Richard Davey
3d580664ef GetText 2017-03-02 23:34:53 +00:00
Felipe Alfonso
a6140d8979 changed the maximum amount of vertices for shape batch 2017-03-02 16:30:37 -03:00
Richard Davey
3826eb732f Working through getting the Bitmap Text size back. 2017-03-02 04:00:39 +00:00
Richard Davey
0ba77e5970 Swapped to using the math const and tidied up eslint errors. 2017-03-02 02:18:04 +00:00
Richard Davey
ed88c8e65a Updated components. 2017-03-02 02:06:53 +00:00
Richard Davey
98eb2e3155 Renderers now using the Origin property. 2017-03-02 02:06:53 +00:00
Richard Davey
91bb3c8a98 Frame calculates its center automatically now (to avoid Sprites having to do it every time they're created, as it'll never change once the Frame is set). 2017-03-02 02:06:53 +00:00
Richard Davey
b21fa19044 Removed anchor property from Transform, and added in the new Origin component. 2017-03-02 02:06:53 +00:00
Felipe Alfonso
06a0a61fcc Line rendering for webgl on Graphics Game Object 2017-03-01 21:40:03 -03:00
Felipe Alfonso
fdc627fb92 Fixed overflowing buffer on Graphics webgl renderer 2017-03-01 20:23:46 -03:00