Author Topic: Drawing an advance line  (Read 6724 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Drawing an advance line
« Reply #15 on: March 09, 2012, 08:55:49 pm »
I've updated the beta-jar with a method update(<SimpleVector[]>) in Polyline. You can update a line with any array of SimpleVectors which length is equals or lower than the one that was used to create the Polyline. The update performance isn't tweaked for performance, but it might be fast enough as it is. If it isn't, please let me know and i'll see if i can improve it slightly.

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Drawing an advance line
« Reply #16 on: March 10, 2012, 02:34:09 am »
Thanks Egon.

And I was right, work asked about animating the line. Which I just thought of an easy idea if you want to add it in :P Would save me from updating the points themselves.
A "setVisableLength(float length)" which could accept 0 to 1.0f. 0 meaning seeing nothing and 1 seeing 100% of the line.
It's not important atm, but would make animating the lines optimised/easier once I get to that.

 

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Drawing an advance line
« Reply #17 on: March 10, 2012, 02:35:54 pm »
I've updated the jar and added a method to Polyline called setPercentage(<float> [0..1]); It defines how much of the line is visible (0= nothing, 1=fully visible). Only full segments can be visible/invisible, i.e. if the line contains only one segment, everyhing below 1 will render it invisible.

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Drawing an advance line
« Reply #18 on: March 10, 2012, 03:13:11 pm »
Awesome stuff. That will make things easier once I get to the animating of lines.