FBA The Creator
http://www.fbacreator.com/fbaforum/

bug in Poly and fillpoly functions
http://www.fbacreator.com/fbaforum/viewtopic.php?f=2&t=110
Page 1 of 1

Author:  Arnold [ Wed Aug 20, 2008 1:43 pm ]
Post subject:  bug in Poly and fillpoly functions

I have found bug in function poly and the same bug in fillpoly

fillpoly(red, green, blue [,px, py][,px, py][,px, py]....)

red, green - changes color but somehow olso became first coordinates px and py
then forth coordinates and left does't work it all.

for ex. please try to use this function instead of fillrect and see what you get :)

ARNOLD

Author:  evilmaio [ Wed Aug 20, 2008 8:12 pm ]
Post subject:  Re: bug in Poly and fillpoly functions

Yes, i found the bug, interested functions are poly and fillpoly (not fillrect).
This will be fixed in next release.

Author:  evilmaio [ Wed Aug 20, 2008 9:59 pm ]
Post subject:  Re: bug in Poly and fillpoly functions

Ok, it should be fixed in current available release (0.2.0.135) ;)

Author:  Arnold [ Thu Aug 21, 2008 5:42 am ]
Post subject:  Re: bug in Poly and fillpoly functions

O, Thanks a lot in last version 0.2.0.135
Poly and fillpoly now works properly.

But i have something like suggestion or may be question
is it possible to use fillpoly or poly function with arrays.
I mean
can i use this functions like this:
local part={}
local maxparts=200
for c=0, maxparts do
part[c]={}
part[c]["x"]=math.random(0, screenwidth())
part[c]["y"]=math.random(-screenheight(), -20)
end

Poly (r ,g, b, part[c]["x"], XStart,part[c]["y"], YStart, Count)

instead of sample:

poly(r, g, b,
math.random(0, screenwidth()), math.random(0, screenheight()),
math.random(0, screenwidth()), math.random(0, screenheight()),
math.random(0, screenwidth()), math.random(0, screenheight()),
math.random(0, screenwidth()), math.random(0, screenheight()),
math.random(0, screenwidth()), math.random(0, screenheight()),
math.random(0, screenwidth()), math.random(0, screenheight())
)



Thanks

ARNOLD

Author:  evilmaio [ Thu Aug 21, 2008 9:39 am ]
Post subject:  Re: bug in Poly and fillpoly functions

You can obtain that (or similar) using the unpack LUA function:

Code:
        
local myarr={}
myarr[1]=10
myarr[2]=10
myarr[3]=40
myarr[4]=10
myarr[5]=40
myarr[6]=40
myarr[7]=10
myarr[8]=40
fillpoly(255, 0, 0, unpack(myarr))


Look here and here for more info

Author:  Arnold [ Thu Aug 21, 2008 5:26 pm ]
Post subject:  Re: bug in Poly and fillpoly functions

O! so easy
Thanks for answer.
I'll try.
I think it must be usefull put this information (about using unpack function of LUA and may be another interesting functions of LUA) somewere in help of FBA on visible place?



ARNOLD

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/