1.0.2 • Published 9 years ago

weex-canvas v1.0.2

Weekly downloads
1
License
Apache-2.0
Repository
gitlab
Last release
9 years ago

weex-canvas

The js for weex canvas component.

How To use?

  1. install it with npm install weex-canvas

  2. write weex code as below:

<template>
    <container>
        <canvas style="width:750;height:750;" id="canvas"></canvas>
    </container>
</template>
<script>
    var Canvas = require('weex-canvas');
    module.exports = {
        ready: function () {
            var ctx = Canvas.getContext(this.$el('canvas'));
            ctx.fillStyle = 'red';
            ctx.fillRect(100, 100, 100, 100);
            ctx.draw();
        }
    }
</script>
  1. run it

Current support API list

  1. ctx.clearRect
  2. ctx.fillRect
  3. ctx.beginPath
  4. ctx.closePath
  5. ctx.moveTo
  6. ctx.lineTo
  7. ctx.arc
  8. ctx.stroke
  9. ctx.fillStyle
  10. ctx.strokeStyle
  11. ctx.lineWidth
  12. ctx.globalAlpha
  13. ctx.translate
  14. ctx.rotate
  15. ctx.scale
  16. ctx.drawImage
  17. ctx.save
  18. ctx.restore
1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago