Posted: 13th Jun 2007 6:32
hey all i was wondering if it was possible to draw boxes(BOX command) and text (TEXT command) on top of sprites on screen... I cant seem to get it to work! heres my quasi-code:

+ Code Snippet
do
cls

`custom mouse sprite
sprite 1,mousex(),mousey(),1

[draw boxes and text]
sync
loop


I want the boxs/text to be drawn on top of the mouse. I thought it would do that naturally since it was later in the loop but i guess it doesnt anyone know how to do this without using sprites for the boxes/text? thanks in advance!!
Posted: 13th Jun 2007 6:57
I think you can - just tell DBPro to DRAW SPRITES FIRST, and it should work like you want...

...I think it will, anyways...
Posted: 13th Jun 2007 8:42
erm... no thats only for 3D stuff... i tried it anyway but none of my sprites show up (probably since im using PASTE IMAGE first to draw a background)
Posted: 13th Jun 2007 11:24
Use the PASTE SPRITE command, it will allow text and other 2D commands to be done on top of the sprite. Had a similar problem with a menu the other day and fixed it by accident with this.

+ Code Snippet
sprite 1,0,0,1
hide sprite 1
do
cls
paste sprite 1,mousex(),mousey()
sync
loop
Posted: 13th Jun 2007 18:56
i tried that out and loaded all my sprites off screen (-50,-50) but since the literal sprites were all on top of eachther all my collisions came true even if the pasted sprites werent touching
Posted: 13th Jun 2007 20:48
yeah thats what my friend suggested... that seems like waay too much work though to do something as simple as drawing text...
Posted: 14th Jun 2007 4:16
hmm ill try that soon thanks
Posted: 22nd Aug 2007 3:00
sry to bump an old thread but im still having this problem... im using WindowsKiller idea and it works except my FPS is slowing down from 80 to 15

Anyone know anyway to do this easily??
Posted: 22nd Aug 2007 13:47
Use the paste sprite command with hide sprite, and your collisions will still work, as long as you position the hidden sprite at the same position as the pasted sprite
Posted: 23rd Aug 2007 0:35
If it's just text why not just use the text command ?
Text X_Pos,Y_Pos,Text$
Try this example...

+ Code Snippet
Sync Rate 0 :  Sync On
Hide Mouse
TH = Text Height("#")/2
TW = Text Width("Text")
CV = (128<<24)||(255<<16)||(128<<8)||(255)
Make Object Cube 1,10
do
 Rotate Object 1,WrapValue(Object Angle X(1)+.02),WrapValue(Object Angle Y(1)+.07),WrapValue(Object Angle Z(1)+.05)
 mx=mousex():my=mousey()
 Box MX-TW,MY-(TH*2),MX+TW,MY+(TH*2),CV,CV,CV,CV
 Center Text MX,MY-TH,"Text"
 sync
loop


Go Create...
Posted: 23rd Aug 2007 5:14
ummm i dont see how tintins idea is related to this at all

at the moment im using something like this:

+ Code Snippet
create bitmap 2,text width("text"),text height("text")
get image 666,0,0,bitmap width(2),bitmap height(2),1
delete bitmap
paste image 666,x,y


or something along those lines... I COULD preload it all except im using a stats type of thing so the data will be changing quite often... could I use a boolean to detect if I have already loaded the text image or not and then when it changes just set the boolean back to 0 so it redraws the image?

I think that will work.... I'll give it a shot
Posted: 23rd Aug 2007 11:58
I can't figure what you actualy want, but here is an edit of my previous code that should hopefuly make it clear.

+ Code Snippet
Sync Rate 0 :  Sync On
Hide Mouse
TH = Text Height("#")
TW = Text Width(Get Time$())
CV = (128<<24)||(255<<16)||(128<<8)||(255)
Make Object Cube 1,10
do
 Rotate Object 1,WrapValue(Object Angle X(1)+.02),WrapValue(Object Angle Y(1)+.07),WrapValue(Object Angle Z(1)+.05)
 mx=mousex():my=mousey()
 Box MX-TW,MY-(TH*1.5),MX+TW,MY+(TH*1.5),CV,CV,CV,CV
 T$=Get Time$()+Chr$(10)+"Obj : "+Str$(Pick Object(mx,my,1,1))
 Center Text MX,MY-TH,T$
 sync
loop

This modification constantly updates the time and show what object the mouse is over...

Go Create...