@pixi/graphics-smooth
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -129,2 +129,3 @@ import { BatchTextureArray } from '@pixi/core'; | ||
maxTextures: number; | ||
pixelLine: number; | ||
} | ||
@@ -135,3 +136,3 @@ | ||
alignment?: number; | ||
scaleMode: LINE_SCALE_MODE; | ||
scaleMode?: LINE_SCALE_MODE; | ||
cap?: LINE_CAP; | ||
@@ -146,2 +147,3 @@ join?: LINE_JOIN; | ||
SHADER_MAX_TEXTURES: number; | ||
PIXEL_LINE: number; | ||
} | ||
@@ -296,3 +298,2 @@ | ||
destroy(options?: IDestroyOptions | boolean): void; | ||
drawStar(x: number, y: number, points: number, radius: number, innerRadius: number, rotation?: number): SmoothGraphics; | ||
} | ||
@@ -389,6 +390,2 @@ | ||
export declare class Star extends Polygon { | ||
constructor(x: number, y: number, points: number, radius: number, innerRadius?: number, rotation?: number); | ||
} | ||
export { } |
{ | ||
"name": "@pixi/graphics-smooth", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "PixiJS v6 plugin for smooth HHAA rendering of shapes", | ||
@@ -5,0 +5,0 @@ "author": "Ivan Popelyshev", |
@@ -61,2 +61,40 @@ # PixiJS Smooth Graphics | ||
### drawStar and other graphics-extras | ||
That's what you have to do if you need functions from graphics-extras package: | ||
```js | ||
import { SmoothGraphics } from '@pixi/graphics-smooth'; | ||
import { Graphics } from '@pixi/graphics'; | ||
import '@pixi/graphics-extras'; | ||
Object.assign(SmoothGraphics.prototype, { | ||
drawTorus: Graphics.prototype.drawTorus, | ||
drawChamferRect: Graphics.prototype.drawChamferRect, | ||
drawFilletRect: Graphics.prototype.drawFilletRect, | ||
drawRegularPolygon: Graphics.prototype.drawRegularPolygon, | ||
drawRoundedPolygon: Graphics.prototype.drawRoundedPolygon, | ||
drawStar: Graphics.prototype.drawStar, | ||
}); | ||
``` | ||
For UMD: | ||
```js | ||
PIXI.smooth.SmoothGraphics.prototype.drawStar = PIXI.Graphics.prototype.drawStar; | ||
``` | ||
### Pixel Perfect | ||
You might notice that for diagonal lines, coverage differs from canvas2d a lot, especially if you do line animations. Solution is easy: | ||
```js | ||
import { settings } from '@pixi/graphics-smooth'; | ||
settings.PIXEL_LINE = 1; | ||
``` | ||
It has to be done before first GraphicsSmooth is created. | ||
This setting is disabled by default because it adds extra computations in coverage calculation. It is not researched yet how it will affect performance. | ||
### What are we working on | ||
@@ -63,0 +101,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1
128
0
799554
10
10111