mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Moves sky sprites to its own package
This commit is contained in:
parent
59817111f0
commit
ebeb8e2d42
@ -3,9 +3,9 @@ library game;
|
||||
import 'dart:async';
|
||||
import 'dart:math' as math;
|
||||
import 'dart:sky' as sky;
|
||||
import 'sprites.dart';
|
||||
|
||||
import 'package:sky/rendering/object.dart';
|
||||
import 'package:sky/widgets/framework.dart';
|
||||
import 'package:skysprites/skysprites.dart';
|
||||
|
||||
part 'game_demo_node.dart';
|
||||
|
||||
@ -14,9 +14,9 @@ import 'package:sky/widgets/navigator.dart';
|
||||
import 'package:sky/widgets/framework.dart';
|
||||
import 'package:sky/widgets/title.dart';
|
||||
import 'package:sky/widgets/theme.dart';
|
||||
import 'package:skysprites/skysprites.dart';
|
||||
|
||||
import 'game_demo.dart';
|
||||
import 'sprites.dart';
|
||||
|
||||
AssetBundle _initBundle() {
|
||||
if (rootBundle != null)
|
||||
|
||||
@ -2,8 +2,11 @@ name: asteroids
|
||||
dependencies:
|
||||
sky: any
|
||||
sky_tools: any
|
||||
skysprites: any
|
||||
dependency_overrides:
|
||||
material_design_icons:
|
||||
path: ../../sky/packages/material_design_icons
|
||||
sky:
|
||||
path: ../../sky/packages/sky
|
||||
skysprites:
|
||||
path: ../../skysprites
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import 'lib/sprites.dart';
|
||||
|
||||
import 'dart:sky';
|
||||
|
||||
import 'package:sky/mojo/asset_bundle.dart';
|
||||
@ -7,6 +5,7 @@ import 'package:sky/rendering/object.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/widgets/basic.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
import 'package:skysprites/skysprites.dart';
|
||||
|
||||
AssetBundle _initBundle() {
|
||||
if (rootBundle != null)
|
||||
|
||||
@ -5,8 +5,7 @@ import 'package:sky/mojo/asset_bundle.dart';
|
||||
import 'package:sky/rendering/object.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
import 'lib/sprites.dart';
|
||||
import 'package:skysprites/skysprites.dart';
|
||||
|
||||
AssetBundle _initBundle() {
|
||||
if (rootBundle != null)
|
||||
|
||||
7
packages/flutter_sprites/.gitignore
vendored
Normal file
7
packages/flutter_sprites/.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
.DS_Store
|
||||
.idea
|
||||
.packages
|
||||
.pub/
|
||||
build/
|
||||
packages
|
||||
pubspec.lock
|
||||
8
packages/flutter_sprites/README.md
Normal file
8
packages/flutter_sprites/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# skysprites
|
||||
|
||||
A minimal Sky project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
For help getting started with Sky, view our online
|
||||
[documentation](https://github.com/domokit/sky_engine/blob/master/sky/packages/sky/README.md).
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
typedef void ActionCallback();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
Point _cardinalSplineAt(Point p0, Point p1, Point p2, Point p3, double tension, double t) {
|
||||
double t2 = t * t;
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
/// A sequence of colors representing a gradient or a color transition over
|
||||
/// time. The sequence is represented by a list of [colors] and a list of
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
abstract class Constraint {
|
||||
void preUpdate(Node node, double dt) {
|
||||
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
class ImageMap {
|
||||
ImageMap(AssetBundle bundle) : _bundle = bundle;
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
/// A [Node] that provides an intermediate rendering surface in the sprite
|
||||
/// rendering tree. A [Layer] can be used to change the opacity, color, or to
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
double convertDegrees2Radians(double degrees) => degrees * math.PI/180.8;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
/// An node that transforms its children using a 3D perspective projection. This
|
||||
/// node type can be used to create 3D flips and other similar effects.
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
/// The super class of any [Node] that has a size.
|
||||
///
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
class _Particle {
|
||||
Vector2 pos;
|
||||
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
library sprites;
|
||||
library skysprites;
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
// TODO: The sound effects should probably use Android's SoundPool instead of
|
||||
// MediaPlayer as it is more efficient and flexible for playing back sound effects
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
enum SoundFadeMode {
|
||||
crossFade,
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
/// A Sprite is a [Node] that renders a bitmap image to the screen.
|
||||
class Sprite extends NodeWithSize with SpritePaint {
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
/// Options for setting up a [SpriteBox].
|
||||
///
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
/// A widget that uses a [SpriteBox] to render a sprite node tree to the screen.
|
||||
class SpriteWidget extends OneChildRenderObjectWrapper {
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
/// A sprite sheet packs a number of smaller images into a single large image.
|
||||
///
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
/// A texture represents a rectangular area of an image and is typically used to draw a sprite to the screen.
|
||||
///
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
|
||||
math.Random _random = new math.Random();
|
||||
@ -1,4 +1,4 @@
|
||||
part of sprites;
|
||||
part of skysprites;
|
||||
|
||||
class VirtualJoystick extends NodeWithSize {
|
||||
VirtualJoystick() : super(new Size(160.0, 160.0)) {
|
||||
6
packages/flutter_sprites/pubspec.yaml
Normal file
6
packages/flutter_sprites/pubspec.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
name: skysprites
|
||||
description: A sprite toolkit built on top of Sky.
|
||||
version: 0.0.1
|
||||
dependencies:
|
||||
sky: any
|
||||
sky_tools: any
|
||||
Loading…
x
Reference in New Issue
Block a user