Draw a curve from a list of points

juanj56

  • *
  • Posts: 22
How i can draw a curve or path from a list of points?

juanj56

  • *
  • Posts: 22
Humm... any ideas?

Epic428

  • Posts: 1118
there is no "draw curved line" block, aside from using code and figuring out how to do it on that level, the alternative would be to use the "draw line" block under when drawing event. Given enough points on the line, it should appear to be a curve without actually being a curve.
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

juanj56

  • *
  • Posts: 22
Thanks for your answer, my idea is do it from code but i can't figure how to do it

SadiQ

  • Posts: 1781
Looking in :Stencyl\plaf\haxe\lib\openfl\1,1,1\flash\display\Graphics.hx you will see the following:
Code: [Select]
/**
* Draws a curve using the current line style from the current drawing
* position to(anchorX, anchorY) and using the control point that
* (<code>controlX</code>, <code>controlY</code>) specifies. The current
* drawing position is then set to(<code>anchorX</code>,
* <code>anchorY</code>). If the movie clip in which you are drawing contains
* content created with the Flash drawing tools, calls to the
* <code>curveTo()</code> method are drawn underneath this content. If you
* call the <code>curveTo()</code> method before any calls to the
* <code>moveTo()</code> method, the default of the current drawing position
* is(0, 0). If any of the parameters are missing, this method fails and the
* current drawing position is not changed.
*
* <p>The curve drawn is a quadratic Bezier curve. Quadratic Bezier curves
* consist of two anchor points and one control point. The curve interpolates
* the two anchor points and curves toward the control point. </p>
*
* @param controlX A number that specifies the horizontal position of the
*                 control point relative to the registration point of the
*                 parent display object.
* @param controlY A number that specifies the vertical position of the
*                 control point relative to the registration point of the
*                 parent display object.
* @param anchorX  A number that specifies the horizontal position of the
*                 next anchor point relative to the registration point of
*                 the parent display object.
* @param anchorY  A number that specifies the vertical position of the next
*                 anchor point relative to the registration point of the
*                 parent display object.
*/
function curveTo(controlX : Float, controlY : Float, anchorX : Float, anchorY : Float) : Void;

Maybe that works?
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

juanj56

  • *
  • Posts: 22
Ok, so i see i need a bezier curve :D now i only need to draw it  on ipad ;) Thanks you so much