Why fabric.js doest work in construct 2?

  • I implement a plugin fabric.js and that doest work, i cant move, rotate... etc... why?

  • Something is amiss with your plugin. You'll need to debug it, aka find at what point it fails. It could be anything really.

  • Referencing R0J0hound 's canvas plugin, you will find that

    1. create a private canvas element

    2. draw on this private canvas element

    3. in "instanceProto.draw()", or "instanceProto.drawGL()", paste ctx of the private canvas element ( just copy these 2 functions )

    • set variable "this.runtime.redraw", and "this.update_tex" to true to enable updating

    I had tested fabric.js (add image) in C2, it worked.

  • Yes, i made this work, just add images, but use the inputs doest work, for example: move object, rotate or resize with the touch or mouse. I don't know why...

  • Yes, i made this work, just add images, but use the inputs doest work, for example: move object, rotate or resize with the touch or mouse. I don't know why...

    Unless you give considerably more information, or preferably a .capx and the plugin so others can test, then the only help that can be offered is guesswork.

    At the very least, show an image of your code. That way, some of the Javascript gurus on here may spot something.

  • Fabric.js does pretty much everything C2 already does, so basically you're putting a car in a car.

    Then there's the Webgl counterpart.....

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • newt

    fabric.js has 2 kinds of canvas

    1. static canvas, which only draw objects(line, circle, triangle, ellipse, rect, polyline, polygon, ...) and (morphing) animation. It is similar with rojo's canvas plugin, with more functions.

    2. interactive canvas, which not only draw objects, but also allows dragging, resizing them with predefine control points.

    Since fabric.js does not use webgl, the performance of moving or rotating objects should be worse then C2 engine ideally.

    But it is still a good (static) canvas api, to draw polygon at runtime.

  • i was trying to implent FabricJs in C2 to build a drawing app. but i get stuck in linking fabric js to This.canvas . can you help me ? can you send me your plugin please ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)