Hello Guest

Author Topic: Simplest way to draw a line.  (Read 6242 times)

VeTaL

  • Newbie
  • *
  • Posts: 18
    • View Profile
Simplest way to draw a line.
« on: May 12, 2012, 02:03:34 pm »
Its me again :)

Now i'm trying to draw a line, using 2dtools.

* This morning i tested Vectrocity, but it failed because of cameras.
* Some minutes ago, i tried to draw a line with Shuriken particles system, it also failed. Possibly, because of coordinate system. Tried to get coordinate of anchor and draw a line between 2 anchors - it failed also.
* Now i tried to draw line with Debug.DrawLine(), but i still see nothing.

Any recommendations, where to look?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Simplest way to draw a line.
« Reply #1 on: May 12, 2012, 02:47:45 pm »
If you need a straight line, create a sprite which is 1x1 square, and then scale it non-uniformly. if you put the anchor at bottom center, then you can use that as position 1 and then scale it on y to match the lenght of the line you need.

VeTaL

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Simplest way to draw a line.
« Reply #2 on: May 13, 2012, 09:33:49 am »
Did you tried it?

I have a deadline quite close, so it would be really cool, if you can provide the code example of drawing a simple line  ;D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Simplest way to draw a line.
« Reply #3 on: May 13, 2012, 11:52:48 am »
Don't know if its suitable for what you're trying to do, but I've posted a sample scene here:
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,293.0.html