hi
im building an editor engine like app
i use sprite lines
using this :
function ResizeLine(index as integer,x as float,y as float,x1 as float,y1 as float)
x# = x
y#= y
x1# = x1
y1# = y1
angle# = AtanFull(x#-x1#,y#-y1#)
length# = sqrt((x-x1)*(x-x1) + (y-y1)*(y-y1))
WorldLength = length#
if GetSpriteExists(SpriteLine[index].id) = 1
SetSpriteSize(SpriteLine[index].id,SpriteLine[index].LineWidth+5,length#)
SetSpriteOffset(SpriteLine[index].id,1,0)
SetSpriteAngle(SpriteLine[index].id,angle#)
SetSpritePositionByOffset(SpriteLine[index].id,x#,y#)
MoveSprite(SpriteLine[index].id,-2.5)
endif
if GetSpriteExists(spriteLine[index].id2) = 1
SetSpriteSize(SpriteLine[index].id2,SpriteLine[index].LineWidth,length#)
SetSpriteOffset(SpriteLine[index].id2,1,0)
SetSpriteAngle(SpriteLine[index].id2,angle#)
SetSpritePositionByOffset(SpriteLine[index].id2,x#,y#)
MoveSprite(SpriteLine[index].id2,-2.5)
endif
if GetSpriteExists(spriteLine[index].id3) = 1
SetSpriteSize(SpriteLine[index].id3,SpriteLine[index].LineWidth,length#)
SetSpriteOffset(SpriteLine[index].id3,1,0)
SetSpriteAngle(SpriteLine[index].id3,angle#)
SetSpritePositionByOffset(SpriteLine[index].id3,x#,y#)
MoveSprite(SpriteLine[index].id3,2.5)
SetSpritePhysicsOn(SpriteLine[index].id3,1)
endif
endfunction
so i always know where the x,y and x1,y1 of the sprite the edges.
now i want to rotate the sprite on its center but i have no idea how to maintain x,y and x1,y1 as these are needed for further research..
thank you for ur time.