I think I just found a bug in the rect (x1,y1,x2,y2,r,g,b) function.
It only happens when you set the resolution to be 480x640 and draw a rectangle with the y2 coordinate beyond the bounds of the screen.
I've replicated this using the HelloWorld sample code listed here:
Code:
---------------------------------------------------
-- FBA Tutorials
--
-- Tutorial / 01 / HelloWorld
--
---------------------------------------------------
--
-- The simplest FBA script, the "HelloWorld" !
--
-- This example shows minimal code required in order to create
-- the main window
---------------------------------------------------
debug("Hello World!")
function onmainloop()
--
-- this routine is called on each frame by FBA. You have
-- to draw all your cool graphics here...
--
fillrect (10,10, screenwidth()-10, screenheight()+10, 100,100,100)
rect (10, 10, screenwidth()-10, screenheight() + 10, 255,255,255)
-- quit if we're pressing stylus/mouse
if (mousedown() > 0) then
quit()
end
end
-- this is an optional event automatically called when your application
-- is about to be closed. You can do here some finalization code (settings save etc)
-- or just ignore it if you don't need it ;)
--
-- don't draw anything here, because after this function your application will be closed ;)
--
function onquit()
end
Basically, if you run this in any resolution other than 480x640, it will work.
The line is question is:
rect (10, 10, screenwidth()-10, screenheight() + 10, 255,255,255)
I've tried several scenarios:
rect (10, 10, screenwidth()-10, screenheight() + 10, 255,255,255) <- crashes
rect (10, 10, screenwidth()-10, screenheight(), 255,255,255) <- crashes
rect (10, 10, screenwidth()-10, screenheight() - 1, 255,255,255) <- does not crash
rect (10, 10, screenwidth()+10, screenheight() - 1, 255,255,255) <- does not crash
If you comment out the rect line, and just do the fillrect (which fills in the same area) it will work.
I'm currently doing a scrolling list which can have up to 100 items. So the ability to draw rects outside of the screen area is important.
Thanks.