Graphics

Pixel~ Graphics

Pixel Graphics Element.

Constructor

new Graphics(canvas)

Source:
Iterates new Graphic element.
Parameters:
Name Type Description
canvas CanvasRenderingContext2d Canvas rendering context (usually Pixel.Stage#draw).

Extends

Methods

arc(a, b, c, d, e, fopt) → {Pixel.Graphics}

Source:
Draws arc.
Parameters:
Name Type Attributes Default Description
a number X position.
b number Y position.
c number Radius.
d number Start angle.
e number End angle.
f boolean <optional>
false Anti-clockwise.
Returns:
Type
Pixel.Graphics

arcTo(a, b, c, d, e) → {Pixel.Graphics}

Source:
Deprecated:
  • Yes
Draws arc.
Parameters:
Name Type Description
a number X position.
b number Y position.
c number Radius.
d number Start angle.
e number End angle.
Returns:
Type
Pixel.Graphics

clearCircle(x, y, radius) → {Pixel.Graphics}

Source:
Clears circular area.
Parameters:
Name Type Description
x number X position.
y number Y position.
radius number Radius of circle.
Returns:
Type
Pixel.Graphics

clearRect(x, y, w, h) → {Pixel.Graphics}

Source:
Clears rectangular area on screen.
Parameters:
Name Type Description
x number X position.
y number Y position.
w number Width.
h number Height.
Returns:
Type
Pixel.Graphics

cropRect(x, y, w, h) → {Pixel.Sprite}

Source:
Overrides:
Crops image based on x, y, width, and height.
Parameters:
Name Type Description
x number X position of crop.
y number Y position of crop.
w number Width of crop.
h number Height of crop.
Returns:
Type
Pixel.Sprite

drawRect(a, b, c, d) → {Pixel.Graphics}

Source:
Draws rectangle.
Parameters:
Name Type Description
a number X position.
b number Y position.
c number Width.
d number Height.
Returns:
Type
Pixel.Graphics

end()

Source:
Resets all values and terminates a chain.

fill(c) → {Pixel.Graphics}

Source:
Sets fill color.
Parameters:
Name Type Description
c string Color used, RGB or Hex.
Returns:
Type
Pixel.Graphics

loadImage(url) → {Promise}

Source:
Overrides:
Loads image based on url.
Parameters:
Name Type Description
url string URL of Image Element.
Returns:
Type
Promise

move(a, b) → {Pixel.Graphics}

Source:
Move to X, Y.
Parameters:
Name Type Description
a number X position.
b number Y position.
Returns:
Type
Pixel.Graphics

shadow(blur, color, offsetx, offsety) → {Pixel.Graphics}

Source:
Sets shadows.
Parameters:
Name Type Description
blur number Blur of shadow.
color string Color of shadow.
offsetx number X offset of shadow.
offsety number Y offset of shadow.
Returns:
Type
Pixel.Graphics

transparency(value) → {Pixel.Graphics}

Source:
Sets transparency.
Parameters:
Name Type Description
value number Value of alpha level.
Returns:
Type
Pixel.Graphics