Skip to content

pencil.js / sprite / SpriteOptions

Interface: SpriteOptions ​

Defined in: sprite.ts:11

Sprite options

Extends ​

Properties ​

PropertyTypeDescriptionInherited fromDefined in
cap?CanvasLineCapHow lines endImageOptions.capcomponent.ts:85
clip| Component<ComponentOptions> | nullOther component used to clip the renderingImageOptions.clipcontainer.ts:26
cursorstring | nullCursor to use when hoverImageOptions.cursorcomponent.ts:81
dashedboolean | number[]Should the line be dashed, you can also specify the dash pattern (ex: [4, 4] or Component.dashes.dots)ImageOptions.dashedcomponent.ts:79
descriptionstringAlternative description of the imageImageOptions.descriptionimage.ts:15
fillStyleColor used to fill, set to null for transparentImageOptions.fillcomponent.ts:73
joinCanvasLineJoinHow lines join between themImageOptions.joincomponent.ts:83
loopbooleanShould the animation loop-sprite.ts:15
opacitynumber | nullOpacity level from 0 to 1 (multiplied with its parents opacity, null means 1)ImageOptions.opacitycontainer.ts:16
origin| string | PositionDefinitionRelative offset (Rectangle based shapes also accept named origins like "center")ImageOptions.origincomponent.ts:87
rotationnumberRotation ratio from 0 to 1 (clockwise)ImageOptions.rotationcontainer.ts:18
rotationCenterPositionDefinitionCenter of rotation relative to this positionImageOptions.rotationCentercontainer.ts:20
roundednumber | DOMPointInit | (number | DOMPointInit)[]Radius of the corners (or a list of radii, see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)ImageOptions.roundedrectangle.ts:10
scale| number | PositionDefinitionScaling ratio or a pair of value for horizontal and vertical scalingImageOptions.scalecontainer.ts:22
shadowPartial<ShadowOptions>Set of options to set a shadowImageOptions.shadowcomponent.ts:89
shownbooleanIs shownImageOptions.showncontainer.ts:14
speednumberSpeed of the animation (1 = one frame per render, 0.5 = one frame every two render …)-sprite.ts:13
strokeStyleColor used to stroke, set to null for transparentImageOptions.strokecomponent.ts:75
strokeWidthnumberStroke line thickness in pixelsImageOptions.strokeWidthcomponent.ts:77
tintStyleOverride the color of all non-transparent pixelsImageOptions.tintimage.ts:13
zIndexnumberDepth orderingImageOptions.zIndexcontainer.ts:24

Released under the MIT License.