Commit Graph

41 Commits

Author SHA1 Message Date
Ian Fischer
b2de6696a3 Pubspec for Asteroids 2015-08-10 15:07:46 -07:00
Ian Fischer
3a2fd489fa Merge pull request #528 from iansf/asteroids_move_main
Move main.dart to lib/main.dart for the game
2015-08-10 15:06:54 -07:00
Ian Fischer
1d661379c9 Move game/main.dart to game/lib/main.dart. 2015-08-10 15:05:54 -07:00
Viktor Lidholt
35bdbbfee0 Updates demo game with changes to Sprites and Nodes 2015-08-10 12:37:44 -07:00
Viktor Lidholt
7b4f41e36c Adds new Layer class 2015-08-10 12:37:12 -07:00
Viktor Lidholt
32359d4b62 Refactors Sprite class to use SpritePaint mix-in for setting paint properties 2015-08-10 12:36:08 -07:00
Viktor Lidholt
e4b8d8a84a Improves particle performance by never having doubles as null (5% gain in performance test) 2015-08-10 10:05:35 -07:00
Ian Fischer
d44ed7dfc3 Move example out of sky/packages to //examples 2015-08-07 17:04:50 -07:00
Ian Fischer
82404e030a Move sky/examples to sky/sdk/lib/example, and code changes to support that change. Fixes T277.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1218593002.
2015-06-26 15:06:40 -07:00
Viktor Lidholt
2e32c6721d Adds support for rotated textures
Adds documentation to Texture and SpriteSheet

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1212073002.
2015-06-25 13:13:33 -07:00
Ian Fischer
82d1eb2fdb Decouple Canvas from DisplayList and map Picture and PictureRecorder more directly to their Skia counterparts.
Also changes the framework dart code to use the
refactored APIs and fixes the various examples and
tests.

R=abarth@chromium.org, ianh@chromium.org

Review URL: https://codereview.chromium.org/1190123003.
2015-06-24 10:21:45 -07:00
Viktor Lidholt
9b1985c237 Adds basic sprite sheet support to sprites
Adds drawImageRect to Canvas bindings

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1204783003.
2015-06-23 16:38:28 -07:00
Eric Seidel
7044a9dc75 Fix game to depend on Sky
Also updated the version range on stocks2.

https://github.com/domokit/mojo/issues/262

R=ianh@google.com

Review URL: https://codereview.chromium.org/1195933004.
2015-06-23 09:55:45 -07:00
Viktor Lidholt
639e47bd7f Adds API documentation, improves the API names, and cleans up code.
R=ianh@google.com

Review URL: https://codereview.chromium.org/1201983004.
2015-06-22 10:13:23 -07:00
Viktor Lidholt
43d97f6903 Correctly handle touches together with zPosition
Renames hitTest to isPointInside

Refactor sorting of children in nodes

Fixes zPosition in sprites and hides internal methods

Adds scaleX / scaleY properties

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1190393004.
2015-06-19 11:15:58 -07:00
Viktor Lidholt
b06190fb7b Adds a SpriteWidget and simplifies sample game setup
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1197493002.
2015-06-19 09:14:12 -07:00
Viktor Lidholt
627aeff31a Optimizes sprite transformations for box to node
Enabling/disabling of handling multiple pointers
Adds basic touch handling

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1179413009.
2015-06-18 15:29:26 -07:00
Hixie
d2d11a04a1 Cleanup of SkyBinding, and resultant yak shaving.
Some files are moved by this:
  Copy framework/node.dart into types/ - preparing for framework/'s decomissioning.
  Move app/scheduler.dart into sky/scheduler.dart - "app" doesn't really make sense.

As part of the SkyBinding cleanup, I made the hit-testing less
RenderBox-specific, by having the HitTestEntry.target member be a
HitTestTarget, which is an interface with the handleEvent() function,
which is then implemented by RenderBox. In theory, someone could now
extend hit testing from the RenderBox world into their own tree of
nodes, and take part in all the same dispatch logic automatically.

This involved moving all the hit testing type definitions into a new
sky/hittest.dart file.

Renamed SkyBinding._app to SkyBinding._instance for clarity.

Moved code around in SkyBinding so that related things are together.

Made WidgetSkyBinding use the existing SkyBinding.instance singleton
logic rather than having its own copy.

I also added some stub README.md files that describe dependencies.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1187393002.
2015-06-17 19:54:11 -07:00
Hixie
5136d5209b Rename AppView to SkyBinding.
Move app/view.dart to rendering/sky_binding.dart since it's part of the RenderObject API, really (it knows about RenderView intimately).
The tests pass. I didn't check every last example.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1183913006.
2015-06-17 17:07:31 -07:00
Adam Barth
8e5245c9a1 Implement ColorFilter in widgets/basic.dart
Also, trim the redundant |Mode| suffix from the TransferMode names.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1188003006.
2015-06-17 17:06:27 -07:00
Adam Barth
99e115d06c Settings menu item in stock2 doesn't work
The underlying problem is that we lacked a RenderObjectWrapper for the
RenderView, which meant we couldn't handle changing the RenderObject that was
the root of the RenderView. This CL introduces a RenderViewWrapper and uses it
in a new AppContainer widget root. This change allows us to make App a
non-magical Component that is inserted into the AppContainer in the newly
introduced runApp function.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1184823006.
2015-06-17 12:36:56 -07:00
Viktor Lidholt
abc8eaa505 Places demo game in a OneChildRenderObjectWrapper and adds a star field and nebula for background
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1187153002.
2015-06-16 10:59:24 -07:00
Viktor Lidholt
6c7a619f99 Updates game for new AppView API
Deletes old test game

Demo game is now playable

Updates demo game with steering and changes in sprites

Fixes smaller bugs in sprites

Refactor class names in game demo

Strips Box2D from game

Fixes ordering in game node

Adds frameRate property to SpriteBox and improves update methods.

Fixes node to box transformations for hit tests

Fixes minor code issues

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1179333002.
2015-06-15 09:11:16 -07:00
Adam Barth
17d3b4957a Rename all the things
This CL moves the bulk of the SkyView code out of the |framework| directory
because the |framework| directory was redundant in Dart package import
declarations.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1177383006.
2015-06-13 09:46:52 -07:00
Adam Barth
c5def50b9c Port sky_home to the new SkyView world
R=ianh@google.com, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1178293004.
2015-06-12 16:53:29 -07:00
Matt Perry
cc5fde4e61 Fix bustage from my previous CL: "Color.fromARGB" becomes "new Color.fromARGB".
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1184523002.
2015-06-11 15:59:10 -04:00
Matt Perry
7357aa443b Remove redundant Paint.setARGB in favor of assigning to Paint.color.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182563002.
2015-06-11 15:43:53 -04:00
Matt Perry
a523d7f3ea Fix up constructor naming style for MaskFilter and ColorFilter.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1179913002.
2015-06-11 13:15:20 -04:00
Viktor Lidholt
dcb0fa4312 Adds hit tests and transformations between coordinate systems in sprites
Sprite nodes use Point instead of Vector2

Updates sprite test app

Refactors accounting for pivot points in sprites

Adds abstract NodeWithSize class in Sprites.

Refactors SpriteNode to Sprite

Refactors TransformNode to Node (may need to find another name as it conflicts with Sky's Node).

Sprite system now uses and caches transformation matrices.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1180703002.
2015-06-11 08:44:22 -07:00
Adam Barth
ac7f2ff860 Ink splashes should start at the touch point
Previously, they always started at the center of the RenderInkWell. Now we
remember the local coordinates we computed during the hit test and provide that
information when handling the event.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1180553002.
2015-06-10 13:55:20 -07:00
Viktor Lidholt
3260d9988d Adds support for zOrder and references to parent nodes in sprites, also start of new test app.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1177563004.
2015-06-10 09:21:01 -07:00
Matt Perry
5a0b18490f Change the ColorFilter constructor to ColorFilter.Mode, in case we want to add
more ColorFilter types.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1163373007.
2015-06-09 14:55:52 -04:00
Hixie
37f0b0240b Convert everything in the Sky API from degrees to radians.
Radians are the one true angle unit.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1164393002
2015-06-08 14:38:06 -07:00
Viktor Lidholt
824a66399e Adds a spaceship and (somewhat crappy) controls to the example game.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1151793003
2015-06-04 17:14:46 -07:00
Hixie
b7c588661c Rename "BorderSide.None" to "BorderSide.none", since it's a constant, and change the sky.Size.infinite() constructor to a constant.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1158263005
2015-06-04 16:17:20 -07:00
Eric Seidel
7ebb281c5c Fix examples/game to work after Hixie's grand rename.
TBR=viktorl@google.com

Review URL: https://codereview.chromium.org/1158273009
2015-06-04 15:25:46 -07:00
Viktor Lidholt
3b06e1e1f7 Adds support for transfer mode in Paint and SpriteNode classes. Adds support for opacity in sprites, and modifies example game.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1164633004
2015-06-04 11:14:07 -07:00
Adam Barth
9bdb39d0ec Fix build after hixie's rename
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1164073002
2015-06-04 10:49:05 -07:00
Adam Barth
e99c880bc2 Fix gesture events in fn2
This CL makes gesture events work again in fn2.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1146923005
2015-06-03 16:06:15 -07:00
Viktor Lidholt
006da931cf Sky example game enhancements, adds preloading of images and adds transform modes to SpriteBox
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1149183004
2015-06-03 15:05:55 -07:00
Viktor Lidholt
3118a6fba1 Initial version of working game with Box2D, images, nodes and sprites.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1161023006
2015-06-02 15:09:01 -07:00