Strok gradient color direction - Doen't working

Hi,

I have copy the below code from corona document (object:Stroke()).

It doesn’t matter what is the value of “direction” (up,down,right or left) - it get the same result. The gradient is always center (i.e. within the inside border of the rectangal outside of it).

Is it a bug ?

Thanks 

   Yuval

local paint = { type = "gradient", color1 = { 1, 0, 0.4 }, color2 = { 1, 0, 0, 0.2 }, direction = "down" } local rect = display.newRect( 200, 200, 300, 300 ) rect.stroke = paint rect.strokeWidth = 4
  1.  I don’t think there is a “center” ( may have missed it?)

https://docs.coronalabs.com/api/type/GradientPaint/index.html

  1. Not sure that is a bug for strokes.   However, if you need to file a bug, here is a project you can submit:

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/10/strokePaint.zip

http://github.com/roaminggamer/RG_FreeStuff/tree/master/AskEd/2015/10/strokePaint

strokePaint.png

Hi,

You can see in the example you attached the BUG. 

Look at the 4 bottom rectangles (Stroke Up,Down,Left and Right) - They are the same!!! 

The gradiant doesn’t working according to the direction apply…

Yuval

Yeah,  I don’t think it is a bug though.  That is just how gradients work on strokes.  I think gradients on strokes ignore the direction.

If you feel it is a bug, file it at the link I provided and feel free to use the code I provided as a ‘demonstration’ if you wish.

Please note: You can get help with questions in the forums, but bugs don’t get fixed out of the forums.  They must be formally submitted.

Oh, and in case its unclear.  I’m not an employee here.  Just another user like yourself.

  1.  I don’t think there is a “center” ( may have missed it?)

https://docs.coronalabs.com/api/type/GradientPaint/index.html

  1. Not sure that is a bug for strokes.   However, if you need to file a bug, here is a project you can submit:

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/10/strokePaint.zip

http://github.com/roaminggamer/RG_FreeStuff/tree/master/AskEd/2015/10/strokePaint

strokePaint.png

Hi,

You can see in the example you attached the BUG. 

Look at the 4 bottom rectangles (Stroke Up,Down,Left and Right) - They are the same!!! 

The gradiant doesn’t working according to the direction apply…

Yuval

Yeah,  I don’t think it is a bug though.  That is just how gradients work on strokes.  I think gradients on strokes ignore the direction.

If you feel it is a bug, file it at the link I provided and feel free to use the code I provided as a ‘demonstration’ if you wish.

Please note: You can get help with questions in the forums, but bugs don’t get fixed out of the forums.  They must be formally submitted.

Oh, and in case its unclear.  I’m not an employee here.  Just another user like yourself.