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

Post your completed addons to share with the community

Post » Fri Sep 05, 2014 5:24 pm

It's okay, @Yann.. we know you might be busy

Also why don't you try to upload attachements instead of dropbox?

Great plugin :)
B
21
S
5
Posts: 244
Reputation: 2,535

Post » Fri Sep 05, 2014 8:37 pm

@Wisdoms > convenience (like arranging various links inside the post for clarity) and habits =)

And to solve the problem I would have to go through most of my post and convert the links to attachement... And as you said, I'm kind of laz... busy
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Sep 11, 2014 10:10 pm

you are brilliant Yann, your plugin is fantastic .. I am also game developer construct 2 years and a few months ago I seek a way to create a game of origami, I needed to have folds in sprites to simulate folded paper ... I think that with this plugin I can? if someone could please show here ...
B
4
Posts: 3
Reputation: 208

Post » Tue Oct 14, 2014 3:33 am

@Yann your Polytrail.capx gave me an error at one point, it said it went beyond the maximum texture size of 2048x2048px.

Really i think drawing polygons should be a basic thing built in every game engine, it's quite pathetic it's not built into Construct 2.

And this plugin is not drawing real polygons, it's using large textures to draw on with Canvas, I mean come on Scirra is it too much to ask to draw real polygons like the ones in Quake 15-years ago????
B
32
S
5
G
1
Posts: 72
Reputation: 3,288

Post » Wed Nov 19, 2014 10:22 pm

Any hope to see the "cutable" polygon capx?
http://www.schizokoa.com we are a small game jam group, visit us!
B
23
S
5
Posts: 44
Reputation: 1,270

Post » Wed Feb 11, 2015 11:58 am

Thanks yann
B
205
S
27
G
13
Posts: 1,834
Reputation: 35,696

Post » Fri Aug 21, 2015 7:18 am

I know I'm late to the party, but is there a way to only get the 'outer' vertices of a set of points to build the polygon, so that the polygon always encompasses all the points? I have a game with multiple objects (~20) that I need to encompass at any time.

Edit: And while I'm at it - is it possible to give the polygon a margin? For example to leave a distance of 10px between each of the positions given and the corresponding polygon vertices (away from the center).
B
9
S
2
Posts: 30
Reputation: 615

Post » Tue Mar 22, 2016 9:01 pm

Hi all, I need some help making an adjustment to this plugin but I'm not sure if @Yann is around anymore

I'm trying to get rid of the anti-aliasing-like smoothing that polygons draw with. I need jagged pixel outlines, (the equivalent of 'point' sampling rather than linear sampling)

I was looking through polygons runtime.js and it's a lot more complex than I thought. Started tinkering with it but idk what I'm really doing.

some (maybe?) important lines:

line 269 has a mention of linear sampling when in webgl mode, I set this to pointSampling, and it had no effect.

line 770 is the 'draw polygon' action.

My hunch is that I should add a line that changes a setting, I found this:
ctx.imageSmoothingEnabled = value;
from here: https://developer.mozilla.org/en/docs/W ... ingEnabled

and I tried adding it in a few places, but I think it's only for canvas2d rather than webgl, so it had no effect.

Any ideas or pointers?

thanks
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sat Mar 26, 2016 10:45 pm

@keepee
Yeah I'm still roaming around sometimes like an old ghost.
Well... These days I'm not "constructing" that much, I'm more into unity, and I've became proficient enough to feel quite limited when I try something on construct :D...

That being said, if I remember correctly and after having reread a bit of the plugin, I'm actually drawing the polygon in a 2D (non webgl) canvas and then using the resulting texture on a WebGL quad.
And according to that StackOverflow answer there's nothing to control the aliasing, you'd have to write things pixels by pixels using some aliasing algorithms (I used one once for grid based line of sight...)

So well... you'd have to either tweak the plugin to just do that, or find a way to draw polygons directly with gl calls (probably sending the vertices composing the polygon on the gpu directly, and since it only accepts triangles, as far as I remember, you would also need a triangulation algorithm... there's one in the box2D/physics plugin I think, for collisions... but yeah it would be a lot of work and I don't remember what C2 is exposing to help you on that... And that's why I choosed the easy road)
And even with that, I'm not sure where C2 activate or deactivate antialiasing for WebGL if it ever does it (I think it does when you choose point sampling... yeah long time no C2 :D)

So yeah, no easy answer on that one, sorry...
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sun Mar 27, 2016 10:00 am

Yann welcome back my boy long time no see
B
205
S
27
G
13
Posts: 1,834
Reputation: 35,696

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: antares330 and 2 guests