I am using Slick2D.
Not i want to draw a line, but a simple sine, i want it to be broad and eventually be animated.
is there an easy way to render something like this?
-lastaid
I am using Slick2D.
Not i want to draw a line, but a simple sine, i want it to be broad and eventually be animated.
is there an easy way to render something like this?
-lastaid
Graphics.drawLine(float x, float y, float x2, float y2)
If by broad you mean you want to change the line thickness, you can use:
Graphics.setLineWidth(float width)
Hey, this works perfectly, even got it to render in color.
But i hate that i have to set it to Graphics and not to the drawLine itself.
is there any more advanced way, like rendering a line with gradient for example?
-lastaid
The graphics is basicly your screen. It makes a lot of sence to daw onto that.
@lastaid
There are:
Graphics.drawGradientLine(float x1, float y1, Color Color1, float x2, float y2, Color Color2);
and
Graphics.drawGradientLine(float x1, float y1, float red1, float green1, float blue1, float alpha1, float x2, float y2, float red2, float green2, float blue2, float alpha2);
For more methods, look at the javadocs: http://slick.cokeandcode.com/javadoc/org/newdawn/slick/Graphics.html