diff --git a/demo/pong/index.js b/demo/pong/index.js index 40f3db7..63f4783 100644 --- a/demo/pong/index.js +++ b/demo/pong/index.js @@ -8,9 +8,9 @@ import { Container, GraphicalType, Rect, - Collision + Collision, + Graphical } from "https://unpkg.com/sparkle-engine/dist/sparkle.js" -import Graphical from "../../src/nodes/graphical" const engine = new SparkleEngine({ // 指定游戏画布元素 diff --git a/package.json b/package.json index 89a7c26..493198d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sparkle-engine", "private": false, - "version": "0.0.8", + "version": "0.0.9", "type": "module", "files": [ "dist/*", diff --git a/src/main.ts b/src/main.ts index 587ebe1..0a1ce15 100644 --- a/src/main.ts +++ b/src/main.ts @@ -31,7 +31,7 @@ import MathUtils from "./math/math" import Animations from "./animation/animation" import { DataResources } from "./loader/loader" import Resources from "./loader/resources" - +import Graphical from "./nodes/graphical" export { Resources, Color, @@ -49,6 +49,8 @@ export { Sprite, Text, Collision, + Graphical, + TextureManager, Texture, diff --git a/src/nodes/graphical.ts b/src/nodes/graphical.ts index 39a8104..b644d00 100644 --- a/src/nodes/graphical.ts +++ b/src/nodes/graphical.ts @@ -1,6 +1,10 @@ -import { GraphicalType, ICircleOptions, IGraphicalOptions, IPolygonOptions, IRectOptions, Path, Rect, Vector2 } from "../main"; +import { GraphicalType, IGraphicalOptions, Rect, Vector2 } from "../main"; import Drawable from "./drawable"; +/** + * 绘制图形,圆形多边形,正方形等 + * @category GameNode + */ class Graphical extends Drawable { type: GraphicalType; path?: Vector2[]