Ok, so everyone and their brother is making a vector glow engine. I would like to make my own too. My problem comes when i try to draw rotated textures. How is this done? I know I need to set the rotation before drawing a stretched texture. However, after doing that the angle is off sometimes. can someone provide a function to draw a given image stretched from point x,y to point x2,y2? Basically i would like to draw a texture that imitates a line. Thanks in advance. My problem is that the line is not drawn centered.
here us my code
here us my code
Function point_direction#(x1#,y1#,x2#,y2#) Local Angle# = ATan2(y2-y1,x2-x1) If angle<0 angle:+ 360 End If Return angle EndFunction Function point_distance#(x1#,y1#,x2#,y2#) ' get the x difference Local x_distance#=Abs(x1-x2) ' get the y difference Local y_distance#=Abs(y1-y2) ' find the difference using pythagroin therom Local distance#=sqr((x_distance*x_distance)+(y_distance*y_distance)) Return distance EndFunction Function draw_texture(x#,y#,x2#,y2#) Local direction=point_direction(x,y,x2,y2-8) Local length=point_distance(x,y,x2,y2) SetRotation direction DrawImageRect(texture,x,y-8,length,16) SetRotation 0 End Function