Rect function

Blitz3D Forums/Blitz3D Beginners Area/Rect function

Arvidsson(Posted 2009) [#1]
Is there anywhere you can see how the rect function code looks like or is it hardcoded in another language mabye?

I want to fill and rotate a couple of areas as fast as possible and thougt I could start of with rect and modify it a little bit.


Bobysait(Posted 2009) [#2]
if that fit what you expect, use 3d accelerated ( with mesh/sprite or want you prefer, then "filling rect" will be as simple as ColorEntity(quad,r,g,b) or BrushColor or the way you want it to be painted )else you can try FastImage that performs the same stuff as Blitzmax does.


Arvidsson(Posted 2009) [#3]
I want to do it in 2d at first to get the basics going. Fastimage?


Terry B.(Posted 2009) [#4]
Function fillRect(startx,starty,width,height,r,g,b)
    color r,g,b
    for a=0 to width-1
        for b = 0 to height-1
            plot startx+a,starty+b
        next
    next 
return
end function 

That should work.


Ross C(Posted 2009) [#5]
That function won't work for rotated rects. I'd give fast image a look. I'm sure you can download as demo.


Arvidsson(Posted 2009) [#6]
I just looked at it briefly but doesn´t fast image require a 3d window?


BLaBZ(Posted 2009) [#7]
Yessah, 3D accelerated 2d = much faster = better, plus you get awesome entity controls =D


xtremegamr(Posted 2009) [#8]
Is there anywhere you can see how the rect function code looks like or is it hardcoded in another language mabye?

I want to fill and rotate a couple of areas as fast as possible and thougt I could start of with rect and modify it a little bit.


I say this from experience: Go with 3D accelerated 2D.

It's faster, like B-labs said, and it's also much less painful. ;)