[PLUGIN] Polygon (update 2013-04-23)

0 favourites
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • Yann thanks for clearing that

    I'm going to figure out how to add colors.

  • Thanks for this Yann

  • Can you do curves, been playing with it and looked at your videos but i can't figure out if you can add curved vertexes? Or make vertex curved (bezier)

  • labithiotis

    nope, it's strictly a "polygon" plugin. as in

    a polygon (pron.: /'p?l?g?n/) is a flat shape consisting of straight lines that are joined to form a closed chain or circuit

    If one day I feel good enough in js and if I find a good way to interface it in ACE, and if I find a good way to generate corresponding collision polygon, I might decide to make a "Shape" plugin.

    But as you can see, there's many "ifs" (:

    And if you don't need collision polygons, I suggest you look at the canvas plugin from R0J0hound

    On another subject, I just updated the polygon plugin, I had left some bugs in the boundingbox calculations.

    Enjoy (:

  • Can you do curves, been playing with it and looked at your videos but i can't figure out if you can add curved vertexes? Or make vertex curved (bezier)

    labithiotis specifically you can make an arc with more than 30 vertexes

  • Yann, thanks for that Plug-In... I appreciate your effort. Of course coming out of the polygon term and going to free-hand shapes (heh, OK, bezier would be just enough) could be even more wonderful!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey yaan ! Coll plugin you got there but what about multiple polygons ? How can I tackle this one ?

  • Whiteclaws simply add the object multiple times.

    Hi Yann thanks for the plugin. I've got a cool idea for a game with this plugin, but I'm stumped at some of the vertex math and was hoping you could help.

    My .Capx attempt

    Essentially I want to leave a a polygonal trail behind the character. My problem is the way the vertices need to be ordered to close the shape correctly.

  • thehen I guess Yann didn't see this one.

    For what you describe I would try a bunch of dummy objects following each other around like a snake.

    Then for every x ticks do a for each ordered by the the objects instance variable "order" ascending, and then do a descending for each to get the vert back to the origin.

  • thehen

    Indeed I missed this post

    Here's a possible solution:


    The idea is to insert new segment by adding a vertex at the begining and end of the list

    To fade the trail you just have to remove the pair of vertices in the middle.

  • Yann many thanks for taking the time to look at this. Unfortunately I can't get it to work.

    With WebGL enabled in Chrome and Canary I get the following log:

    WebGL: INVALID_VALUE: texImage2D: no canvas

    With WebGL disabled I get this alert:

    Javascript error!Uncaught Error: InvalidStateError: DOM Exception 11http://localhost:50000/Polygon_plugin.js, line 231 (col undefined)This is either a bug in Construct 2 or a problem in a third party plugin or behavior - please report it to the developer!

    Any help would be great! Thanks again!

  • thehen

    Oh yeah sorry, that's a bug happening when the polygon got no size, ctx.drawImage() doesn't like it.

    I corrected the bug, but forgot to update :D

    Should be updated in less than an hour (:


    hop! updated

    not sure if I solved it the right way (I force the width and height to be at a minimum of 1)

  • Yann oops doesn't look like it's updated?

  • thehen

    Super weird

    To be sure open runtime.js and check if there is a line with

    var MIN_SIZE = 1;[/code:3hc77qfi]
    If it's the case, you should have the last version (same as mine).
    I'm reposting the link here just in case 
    If you have the same version, and if you still have the same bug hmmmmmmm
    ... trying on firefox.....
    hmmm working...
    Well at least double check, and if you still have the problem, I'll investigate since it would mean it's a plugin bug (:
  • Yann excellent, that works a treat! Thanks again for the work on this plugin!

    I am now however getting errors in the physics demo. Not sure if that's related?

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