FillGradient no good work with balance

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

FillGradient no good work with balance

Post by sinisrus »

Hello,

I have problem with Fillgradient and ballance

Test 1 Ballance work 0.0 at 0.9 if balance=1 =>no work
Test 2 if i use colors table balance => no work

Code: Select all

/*Test 1*/
SetFillStyle(#FILLGRADIENT, #CONICAL, #RED,#BLUE,0,{balance=1})
BOX(50,5,100,100,#BLACK)

/*Test 2*/
SetFillStyle(#FILLGRADIENT, #CONICAL, 0,0,0, {balance=1,Colors = {#RED, 0,#BLUE, 1}})
BOX(50,150,100,100,#BLACK)
Thank you
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: FillGradient no good work with balance

Post by airsoftsoftwair »

Once again, you need to be more precise in your reports. What do you expect and what do you get? Just saying "no work" doesn't really help much...
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: FillGradient no good work with balance

Post by sinisrus »

Test my script and change balance value for look the problem
I sorry is not possible for me to say more juste balance no work correctly :-/
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: FillGradient no good work with balance

Post by airsoftsoftwair »

Well, then post a picture of what you expect the conical gradient to look like with balance 1.0 and what it currently looks like. I've tried your script and I still don't see the problem.
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: FillGradient no good work with balance

Post by sinisrus »

Ok after test only FillGradient with balance no work if use colors table

Code: Select all

BeginDoubleBuffer(True) 

i=0
Function p_Move()
cls()
IF i>10 then i=0

SetFillStyle(#FILLGRADIENT, #CONICAL, #RED,#BLUE,0,{Balance=i*0.1})
BOX(10,5,50,50,#BLACK)
Textout(65,25,"Work "..i*0.1)

SetFillStyle(#FILLGRADIENT, #CONICAL, 0,0,0, {balance=i*0.1,Colors = {#RED, 0,#BLUE, 1}})
BOX(10,65,50,50,#BLACK)
Textout(65,85,"No work "..i*0.1)

Flip()
i=i+1
EndFunction

SetInterval(1, p_Move, 1000/5) ; 50fps
 

/* Boucle infinie */
Repeat
        WaitEvent
Forever
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: FillGradient no good work with balance

Post by airsoftsoftwair »

Thanks, now I see what you mean. Will be fixed.
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: FillGradient no good work with balance

Post by sinisrus »

Thank you for your patience ;)
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: FillGradient no good work with balance

Post by airsoftsoftwair »

Ok, so that's rather a bug in the documentation. "Balance" is ignored for #CONICAL when using multiple colors because in that case the balancing between the individual colors in the "Colors" table is defined by the individual color stops in that table. Relating to your example, it can be fixed like this then:

Code: Select all

SetFillStyle(#FILLGRADIENT, #CONICAL, 0,0,0, {balance=i*0.1,Colors = {#BLUE, 0,#RED, i*0.1,#BLUE,1}})
Then it'll work correctly. I'll also adapt the doc to mention that "Balance" is ignored if #CONICAL is used with multiple colors.
Post Reply