Check if Path is Closed

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
I am looking for a way to check if a drawn path becomes closed, when the path is being drawn by lines created when a cursor is moved with the arrow keys (Imagine drawing lines to make a circle using the arrow keys). I can get the lines to draw, but I can't figure out how to check when the path makes a closed "shape"/area.


If anyone has a good idea of how I can check when a path becomes closed, please let me know!
 

taarna23

Marshmallow Princess
Global Mod
Joined
Jul 20, 2012
Messages
2,402
Reaction score
4,966
First Language
English
Primarily Uses
RMMZ
Do you have a way to record the start and end locations of the shape? If so, check that they are at the same location.
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
I don't think I can make that comparison, since the "end point" of the shape can be any part of the line, not just the start point. Imagine drawing a "6", where the end of the tail is the start point, the cursor draws the rest, then closes in the middle, making a closed circle. I need to detect when that circle becomes closed.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top