Hi
I tryed to make a Line in the widget without animation.
I did it and it worked except that the line is not drawing it self on time like it takes 2 sec to draw.
And is it possible to make the line like only horizontally and vertically like (-|) not (/)?
This uses Finterpto to interpolate on event tick from 0 to last index in points array, make sure you set DrawArrayIndex back to zero when you want draw again (or you can change Target to 0 instead of last index.
Then you have 3 operations on arrays:
clear draw array, probably unnecessary here, but added just for clarity of code.
then copy/set draw array to what whole Points array contains
last is resizing it (which will cut exceeding points)
Result should be points from 0 to INT(Draw Array Index), and those you draw in that widget part from your first post.
Also you may want to optimize that event tick code:
remember last index integer (Truncate result) value in separate variable.
do not call whole part with arrays operations until that integer index changed (so you update array only when array needs to be updated, and not on every tick
ps.
play with interpto speed and density of points to make if slower/faster.
and there is idea for future:
instead of using fixed points from array, use those points as target where vector interpto is aiming. So draw all points until most recent one, then use vector interpto to approximate end of line smoothly, then update array and make interpto to new end of the line point.
pps (And important):
My code will start working from begin play or construct event.
So you should add boolean or some variable and brach node where you feed target index to interpto.
When you are not ready for drawing points make target “0”, and when you want it to draw points set it to what it is now in code