Gradient #Linear bug with rotate

Report any Hollywood bugs here
Post Reply
sinisrus
Posts: 251
Joined: Tue Apr 21, 2015 5:43 pm

Gradient #Linear bug with rotate

Post by sinisrus » Thu Oct 11, 2018 4:41 pm

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

sinisrus
Posts: 251
Joined: Tue Apr 21, 2015 5:43 pm

Re: Gradient #Linear bug with rotate

Post by sinisrus » Thu Oct 11, 2018 11:38 pm

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

sinisrus
Posts: 251
Joined: Tue Apr 21, 2015 5:43 pm

Re: Gradient #Linear bug with rotate

Post by sinisrus » Thu Oct 11, 2018 11:38 pm

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

User avatar
airsoftsoftwair
Posts: 2670
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Gradient #Linear bug with rotate

Post by airsoftsoftwair » Sat Oct 13, 2018 12:21 am

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.

sinisrus
Posts: 251
Joined: Tue Apr 21, 2015 5:43 pm

Re: Gradient #Linear bug with rotate

Post by sinisrus » Sun Oct 14, 2018 1:37 am

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

User avatar
airsoftsoftwair
Posts: 2670
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Gradient #Linear bug with rotate

Post by airsoftsoftwair » Wed Oct 17, 2018 9:50 pm

Ok, I see, will be fixed.

User avatar
airsoftsoftwair
Posts: 2670
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Gradient #Linear bug with rotate

Post by airsoftsoftwair » Sun Dec 09, 2018 2:37 pm

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

Post Reply