kofstreet's Recent Forum Activity

  • Here's some examples:

    c2:

    https://www.dropbox.com/s/rpi4nzhd763b4l6/pointInPoly.capx?dl=1

    https://www.dropbox.com/s/65neg3btcb6mdzr/pointInPoly2.capx?dl=1

    c3:

    https://www.dropbox.com/s/ga41909z93g71nq/pointInPoly2.c3p?dl=1

    I ended up converting the text point list to an array, but otherwise the math is the same.

    Thanks, this is what I'm looking for.

    My example without array:

    we.tl/t-2oO3RG9BoP

  • > 1) collision polygon in a sprite is not allowed when dealing with a large number of vertices.

    I tried adding about 300 points to the collision polygon with that addon and it was working fine. Of course, I wouldn't do it on every tick.

    4000 vertices is a bit too much. I'm curious why do you need that many?

    I need for parcel managing in a map.

  • For the math method you can do it by looking at a line from the point going down. If it crosses an odd amount of lines it’s inside the polygon, otherwise it’s inside.

    Here is what the events would look like if you just had sprites making up the points. You could use an array or text list but I’ll leave that as something that would need to be adapted.

    Global number x=100

    Global number y=100

    Global number inside=0

    Global number i=0

    Global number j=0

    Repeat p.count times

    — set i to loopindex

    — set j to (i+1)%p.count

    — value (x-p(i).x)/(p(j).x-p(i).x) is between 0 and 1

    — y > (p(j).y-p(i).y)/(p(j).x-p(i).x)*(x-p(i).x)+p(i).y

    — — set inside to 1-inside

    will appreciate a lot if you can translate your math method in an example on construct.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's probably a math method to do this, but I don't know it. And there are a couple of "dumb" methods, which I would probably use :)

    1. Create a collision polygon in a sprite with this addon. Then check if this sprite is overlapping a point.

    2. Draw the polygon on a drawing canvas, fill it with color. Then save a snapshot and read pixel color at point coordinates.

    1) collision polygon in a sprite is not allowed when dealing with a large number of vertices.

    2) Also drawing canvas can't support drawing polygon with big number of vertices (I naaed solution for dealing with polygon with more than 4000 vertices)

    Thanks anyway, first time heard about an addon allowing sprite collision manipualtion

  • I have a large number of points (x,y) forming a polygone, is there any simple way in construct 3,to check if a point is inside my polygone?

    polygone is a texte based coordinate x1,y1;x2,y2;......xn,yn;

    Thanks.

    Tagged:

  • maybe browser.Referrer ?

    Maybe, but if there is a way for opening C3 android or iOS app from URL link.

  • try using construct.net/en/make-games/manuals/construct-3/plugin-reference/browser

    I use Browser plugin for uploaded web apps, but is there any way for making it working on android (or iOS) apps? (apk and ipa)

    Thanks.

  • Hi,

    I'm working on navigation app, based on geolocation plugin, I need to open my android app from link with latitude and longitude coordination as parameter.

    Thanks, and your feedback is very appreciated for me.

  • Try disabling worker. I hade same problem when worker was enabled.

  • Thanks for saving my life, disabled experimental features and wordked perfectly.

  • Tried to change font on version R226, C3 close in both NW and broser.

    Thanks.

    Tagged:

kofstreet's avatar

kofstreet

Early Adopter

Member since 26 Oct, 2016

None one is following kofstreet yet!

Trophy Case

  • 8-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies