Page 1 of 1

Gradient #Linear bug with rotate

Posted: Thu Oct 11, 2018 4:41 pm
by sinisrus
Hello,

Gradient #Linear bug with rotate

Code: Select all

Function Move()
Cls()
SetFillStyle(#FILLGRADIENT, #LINEAR, 0, 0, k, {colors={#GREEN,0.25,#RED,0.5,#BLUE,0.75,#YELLOW,1}})
BOX(#CENTER,#CENTER,300,100,#BLACK,{Rotate=k,AnchorX=0.5, AnchorY=0.5})
k=k+1
Flip()
EndFunction

SetInterval(1, Move, 1000/100)


EscapeQuit(True)

/* Boucle infinie */
Repeat
        WaitEvent
Forever

Re: Gradient #Linear bug with rotate

Posted: Thu Oct 11, 2018 11:38 pm
by sinisrus
sinisrus wrote: Thu Oct 11, 2018 4:41 pm Hello,

SelectDisplay(1) BeginDoubleBuffer(True) Flip()

Gradient #Linear bug with rotate

Code: Select all

Function Move()
Cls()
SetFillStyle(#FILLGRADIENT, #LINEAR, 0, 0, k, {colors={#GREEN,0.25,#RED,0.5,#BLUE,0.75,#YELLOW,1}})
BOX(#CENTER,#CENTER,300,100,#BLACK,{Rotate=k,AnchorX=0.5, AnchorY=0.5})
k=k+1
Flip()
EndFunction

SetInterval(1, Move, 1000/100)


EscapeQuit(True)

/* Boucle infinie */
Repeat
        WaitEvent
Forever

Re: Gradient #Linear bug with rotate

Posted: Thu Oct 11, 2018 11:38 pm
by sinisrus
sinisrus wrote: Thu Oct 11, 2018 11:38 pm
sinisrus wrote: Thu Oct 11, 2018 4:41 pm Hello,

Gradient #Linear bug with rotate

Code: Select all

SelectDisplay(1)  BeginDoubleBuffer(True) Flip()

Function Move()
Cls()
SetFillStyle(#FILLGRADIENT, #LINEAR, 0, 0, k, {colors={#GREEN,0.25,#RED,0.5,#BLUE,0.75,#YELLOW,1}})
BOX(#CENTER,#CENTER,300,100,#BLACK,{Rotate=k,AnchorX=0.5, AnchorY=0.5})
k=k+1
Flip()
EndFunction

SetInterval(1, Move, 1000/100)


EscapeQuit(True)

/* Boucle infinie */
Repeat
        WaitEvent
Forever

Re: Gradient #Linear bug with rotate

Posted: Sat Oct 13, 2018 12:21 am
by airsoftsoftwair
Huh, what is this? Three bug reports or one? Where is the description? Don't just post code but describe what you expect to see and what you get.

Re: Gradient #Linear bug with rotate

Posted: Sun Oct 14, 2018 1:37 am
by sinisrus
Hello,

I'm sorry I wanted to edit my post but I did not find the "edit" button.

Is only one problem with the gradient and the rotation => the gradient is stretched during the rotation
The Green, Red, Blue and Yellow colors should always be visible in Box()

Thnak you

Re: Gradient #Linear bug with rotate

Posted: Wed Oct 17, 2018 9:50 pm
by airsoftsoftwair
Ok, I see, will be fixed.

Re: Gradient #Linear bug with rotate

Posted: Sun Dec 09, 2018 2:37 pm
by airsoftsoftwair
Ok, so this isn't a bug but a feature ;) Hollywood will always draw the gradient on the whole object (i.e. including transparent regions). That's why some colors like green and yellow sometimes become invisible. They are still there, but they're in the transparent part of the layer so you just can't see them although they are there.

So, to do what you want, just use a brush instead, like so:

Code: Select all

BeginDoubleBuffer

CreateGradientBrush(1, 300, 100, #LINEAR, 0, 0, k, {colors={#GREEN,0.25,#RED,0.5,#BLUE,0.75,#YELLOW,1}})

Function Move()
Cls()
DisplayBrush(1, #CENTER, #CENTER,{Rotate=k,AnchorX=0.5, AnchorY=0.5})
k=k+1
Flip()
EndFunction

SetInterval(1, Move, 1000/100)


EscapeQuit(True)

/* Boucle infinie */
Repeat
        WaitEvent
Forever