Sign in to follow this  
botoman

Method Graphics.lineTo and drawing lines

Recommended Posts

Hello,
I found the method "lineTo" into the graphics class, but it's body is empty. 
What's the purpose of this method? Was it created for future development?
My need is to drawing a simple line between two points; what's the best way to do this?

Thank you,
Alex

Share this post


Link to post
Share on other sites

@botoman

Good find, that was missing from the engine!

I have now added new drawLine function to Graphics class:

// Draw red 2px line from 0,0 to 100,100
var grap = new game.Graphics();
grap.lineWidth = 2;
grap.lineColor = '#ff0000';
grap.drawLine(0, 0, 100, 100);

Just update your engine to latest dev version. Let me know how it works!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.