How do I import existing canvas of animated logo in C2?

0 favourites
  • 4 posts
From the Asset Store
Epic and powerful sounding logos with industrial, electronic feel. 24 Audio elements.
  • I'm just wondering, there an existing script to import logo which is programmed with pure javascript.

    Is possible to import this canvas in C2?

  • Try Construct 3

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

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

    Hello, do you think it's possible to import external canvas with your canvas plugin?

  • Not with the canvas plugin, it wasn't designed for it. It can be done if you wish to delve into the plugin sdk.

    With webgl off html5 canvases are as easy to draw as any other image so the main thing you'd need to change in a plugin is the draw() function to basically this:

    instanceProto.draw = function(ctx)
    {
    ctx.save();
    ctx.rotate(this.angle);
    ctx.drawImage(document.getElementById("myCanvas"),
    		0 - (this.hotspotX * this.width),
    		0 - (this.hotspotY * this.height),
    		this.width,
    		this.height);
    ctx.restore();
    };
    [/code:34paskcx]
    Where "myCanvas" is the id of the canvas you want to draw in C2.  It has to exist somewhere on the webpage.
    
    Making it work with webgl "on" requires converting the canvas to a webgl texture every time and that's not exactly a fast operation.  You can reference my canvas plugin to see one way to do it.
  • R0J0hound Thanks!

    I will see I can do with your snippet, I hope it would work.

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