![]() |
Circle polygon maybe?
I've been searching for a way to draw a circle and then from the center of the circle designate different areas (such as Up, Left, Right, Down = 90degrees) from the circle. I don't understand drawpolygon(), and I won't pretend to. I was also wondering if I do get the circle or areas created could they be hidden. I am really not sure how to accomplish this and I can't use an image for the circle.
|
To draw a circle you'll need to use sine and cosine
PHP Code:
To get a a circle on a quadrant plane you use X = ORGINX + RADIUS * cos( ANGLE); Y = ORGINY - RADIUS * sin( ANGLE); Orgins are the center x/y points of the circle Radius is the number of tiles for the center point Angle is the well the angle from the center that we are drawing As for moving along angles, it involves sine and cosine again. PHP Code:
So it gets values in vectors. Grall operates as so, East is 0/360 degrees and north is 90 degress and so forth. |
It'd be better to define how many vertices for the loop.
PHP Code:
|
Ok Thanks, the circle works fine, but I can't seem to getangle() to show the angle of said circle. I am unsure of how to get the angle of the circle.
Sorry I could also use a little help with delta x and delta y (Like if the mouse is in front of the player and the player is following it) I have tried getdir() but it only works for Right and Down. |
Quote:
PHP Code:
|
Thank you all I believe I understand it now!
|
| All times are GMT +2. The time now is 09:58 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.