├── src
├── index.ts
└── SVG.ts
├── .gitignore
├── tsconfig.json
├── types
└── d-path-parser.d.ts
├── .github
└── workflows
│ └── nodejs.yml
├── LICENSE
├── README.md
├── package.json
└── examples
└── index.html
/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './SVG';
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | *.log
4 | dist
5 | lib
6 | docs
7 | example.api.json*
8 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@pixi/extension-scripts/lib/configs/tsconfig.json",
3 | "include": [
4 | "./src/**/*.ts",
5 | "./types/*.d.ts"
6 | ]
7 | }
--------------------------------------------------------------------------------
/types/d-path-parser.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'd-path-parser' {
2 | interface Point {
3 | x: number;
4 | y: number;
5 | }
6 | interface Command {
7 | code: string;
8 | value: number;
9 | end: Point;
10 | cp1: Point;
11 | cp2: Point;
12 | cp: Point;
13 | rotation: number;
14 | radii: Point;
15 | clockwise: boolean;
16 | large: boolean;
17 | }
18 | export default function parse(path: string): Command[];
19 | }
--------------------------------------------------------------------------------
/.github/workflows/nodejs.yml:
--------------------------------------------------------------------------------
1 | name: Node.js CI
2 | on:
3 | push:
4 | branches: [ '**' ]
5 | tags: [ '**' ]
6 | pull_request:
7 | branches: [ '**' ]
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v3
13 | - name: Use Node.js 16.x
14 | uses: actions/setup-node@v3
15 | with:
16 | node-version: 16
17 | cache: 'npm'
18 | - name: Install npm
19 | run: npm install -g npm@8
20 | - name: Install dependencies
21 | run: npm ci
22 | - name: Built and Test
23 | run: npm test
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The pixi-svg License
2 |
3 | Copyright (c) 2017 Matt Karl, LLC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PixiJS SVG Graphics
2 |
3 | SVG to Graphics DisplayObject for PixiJS.
4 |
5 | [](https://github.com/bigtimebuddy/pixi-svg/actions?query=workflow%3A%22Node.js+CI%22)
6 |
7 | ## Examples
8 |
9 | See SVG and pixi.js side-by-side comparisons:
10 | https://mattkarl.com/pixi-svg/examples/
11 |
12 | ## Install
13 |
14 | ```bash
15 | npm install pixi-svg --save
16 | # or
17 | yarn add pixi-svg
18 | ```
19 |
20 | ## Usage
21 |
22 | For an inline SVG element:
23 |
24 | ```html
25 |
28 | ```
29 |
30 | Create a new `PIXI.SVG` object, provide the `