Hello. I have body which looks like 4/5 of square. I need to my polygon to be centered like full square of this size. Is it posible, to change .x and .y points?
Im not sure what you want but maybe this will help
https://docs.coronalabs.com/api/type/DisplayObject/anchorX.html
https://docs.coronalabs.com/api/type/DisplayObject/anchorY.html
Good Luck!
I love you man! It’s not the best mark for my problem, but it solves graphical stuff very good
I think what you might want is to realign the points on your path so that when you generate a polygon display object it is centred. I have written a library routine to do this in my mathlib.lua:
https://code.coronalabs.com/code/mathliblua
Use the math.centrePolygon function. While this function in particular is not demonstrated, there is a main.lua showing how to use a number of the functions in the library. (Please let me know if anything is broken or if you would like use cases for any particular function!)
Im not sure what you want but maybe this will help
https://docs.coronalabs.com/api/type/DisplayObject/anchorX.html
https://docs.coronalabs.com/api/type/DisplayObject/anchorY.html
Good Luck!
I love you man! It’s not the best mark for my problem, but it solves graphical stuff very good
I think what you might want is to realign the points on your path so that when you generate a polygon display object it is centred. I have written a library routine to do this in my mathlib.lua:
https://code.coronalabs.com/code/mathliblua
Use the math.centrePolygon function. While this function in particular is not demonstrated, there is a main.lua showing how to use a number of the functions in the library. (Please let me know if anything is broken or if you would like use cases for any particular function!)