No problem. Just to add to this here's an example of how you would alter your render target if you needed to update something on it:
// rect2 = rectangle 2d - stores rectangles positions
type rect2
x, y, w, h
endtype
global _rect2 as rect2
// set up screen
sync on : sync rate 0
set text size 20
// set up our text sheet via a render target
make image 1,screen width(),screen height()
draw to image 1
for n = 0 to 2000
text rnd(screen width()),100+rnd(screen height()-140),"Hello World"
next
// important bit - since "screen fps: " doesn't change put it on our image
text 64, 64, "screen fps: "
draw to bitmap 0
make object cube 1,1
color object 1,rgb(128,128,128)
do
r# = wrapvalue(r#+0.25)
rotate object 1,r#,r#,0
// what we are doing here is checking if a variable on the image needs updating.
// if it does, we first work out where it is on the image and then remove it by colouring
// it the same as our alpha channel which is rgb(0,0,0), then we add the new text
// in it's place.
if fps <> lastFps
draw to image 1
// work out where it is and store it in a rect2
start = len("screen fps: ") // - the start position we want to clear from
size = len(str$(lastFps)) // - the end position we want to clear to
getInStringRect( 64, 64, "screen fps: "+str$(lastFps), start, size )
// now we've worked out the postion we can update our text on our image
ink rgb(0,0,0),0
box _rect2.x, _rect2.y, _rect2.x+_rect2.w,_rect2.y+_rect2.h
ink rgb(255,255,255)
text _rect2.x,_rect2.y,str$(screen fps())
draw to bitmap 0
lastFps = fps
endif
// the final result
paste image 1,0,0,1
lastFps = fps
fps = screen fps()
sync
loop
// gets the rectangular position of part our text
function getInStringRect( x, y, str as string, start, size )
local cutString0 as string
local cutString1 as string
cutString0 = mid$(str, 1, start)
cutString1 = mid$(str, start+1, size)
_rect2.x = x + text width(cutString0)
_rect2.y = y
_rect2.w = text width(cutString1)
_rect2.h = text size()
endfunction
Something to take note of is you don't want to make loads of render targets. For all my text in my editor I only use 1 render target.
"Get in the Van!" - Van B