5.0.22 • Published 6 years ago

dibujo v5.0.22

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

alt text

Instalation

How to use it

  const render = new dibujo.Render()

Scene

const scene = new dibujo.Scene('#FF00FF')
  const rect = new dibujo.Rect({
    position: new dibujo.Vector(10, 10),
    width: 100,
    height: 100,
    color: 'blue'
  })
  
  scene.add(rect)
 render.setScene(scene)

Graphics

  • Rect
  • Circle
  • Picture
  • Line
  • Poligon
  • Text
  • Arc

Picture

  const picture = new dibujo.Picture({
    position: new dibujo.Vector(10, 10),
    width: 100,
    height: 100,
    src: './apple.png'
  })
ParamTypeDescription
positionobjectThis object contains the position of the image
srcstringThis will be the location where the image is saved
widthnumberThe width
opacitynumberThe opacity
heightnumberThe height

Rect

  const rect = new dibujo.Rect({
    position: new dibujo.Vector(10, 10),
    width: 100,
    height: 100,
    color: 'blue'
  })
ParamTypeDescription
positionobjectThis object contains the position of the rect
colorstringThe color of the rect
widthnumberThe width
heightnumberThe height
strokebooleanDraw stroke
lineColornumberStroke color
lineWidthnumberLine width

Text

  const text = new dibujo.Text({
    position: new dibujo.Vector(10, 10),
    content: 'Hello World'
  })
ParamTypeDescription
positionPointThe coordinates of the text
contentstringThe content
styleobjectThis is the style of the text

Line

  const line = new dibujo.Line({
    start: new dibujo.Vector(10, 10),
    end: new dibujo.Vector(20, 20),
    color: 'blue'
  })
ParamTypeDescription
startPointThe start coordinate of the line
endPointThe end coordinate of the line
colorstringThis is the color of the line

Poligon

  const poli = new dibujo.Poligon({
    cords: [
      {x: 10, y: 10},
      {x: 20, y: 20},
      {x: 10, y: 20}
    ],
    color: 'blue'
  })
ParamTypeDescription
cordsArrayArray of the vertex of the poligon
fillbooleanFill the poligon
strokebooleanStroke the poligon
strokeColorstringThis is the color of the lines of the poligon
colorstringThis is the color of the poligon

Circle

  const circle = new dibujo.Circle({
    position: new dibujo.Vector(10, 10),
    radius: 10,
    color: 'blue'
  })
ParamTypeDescription
positionPointPosition of the circle
radiusnumberRadius of the circle
colorstringColor of the circle
strokebooleanShow stroke
lineWidthnumberWidth of the line
lineColorstringColor of the line

Arc

  const arc = new dibujo.Arc({
    position: new dibujo.Vector(10, 10),
    radius: 10,
    color: 'blue'
  })
ParamTypeDescription
colorstringColor of the arc
positionPointPosition of the arc
radiusnumberRadius of the arc
lineWidthnumberWidth of the line
strokebooleanShow stroke
lineColorstringColor of the line
eAnglnumberEnd angle of the arc
aAnglnumberStart angle of the arc
5.0.22

6 years ago

5.0.21

6 years ago

5.0.20

6 years ago

5.0.18

6 years ago

5.0.17

6 years ago

5.0.16

6 years ago

5.0.15

6 years ago

5.0.14

6 years ago

5.0.13

6 years ago

5.0.12

6 years ago

5.0.11

6 years ago

5.0.10

6 years ago

5.0.9

6 years ago

5.0.8

6 years ago

5.0.7

6 years ago

5.0.6

6 years ago

5.0.5

6 years ago

5.0.4

6 years ago

5.0.3

6 years ago

5.0.2

6 years ago

5.0.1

6 years ago

4.0.0

6 years ago

3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago