Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / D3D 2D plugin - how do you use Opaque text with D3D ?

Author
Message
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 14th Sep 2011 20:43
hi,

Anyone know how to create Opaque text with the D3D plugin ?

D3D_Init
D3D_StartText
D3D_Font 2,"Arial",9,1,0,1
D3D_Color 255,255,255,255
D3D_Text 2,342,651,2,"How do I make this text Opaque?"

seems tobe tranparent no matter.... thx

Rais
23
Years of Service
User Offline
Joined: 7th Jul 2003
Location:
Posted: 14th Sep 2011 20:59
Your missing the D3D_EndText command. The following works for me

DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 14th Sep 2011 21:04
I have the d3d_endtext command, just forgot it here, hoever text is still transparent ???

Any ideas how to make a opaque text ?

Rais
23
Years of Service
User Offline
Joined: 7th Jul 2003
Location:
Posted: 14th Sep 2011 21:12 Edited at: 14th Sep 2011 21:13
If the small piece of code i posted above doesnt work then I have no idea. If it does work but your still having problems with your program then it may be worth posting more code for us to have a look at.

One thing to note is that the StartText and Endtext have to be fairly close together, you cant have loads of code inbetween. Also any changes to the display mode clears the d3d settings.
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 14th Sep 2011 21:15
It works, it just appears transparent when i print over exisitng text, I need the equivalent of

Set Text Opaque, but for D3D.


If what you said makes it opaque, then how would you make it appear transparent over a background ?

DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 14th Sep 2011 21:24
D3D_Init
D3D_Font 2,"Arial",9,1,0,1
D3D_Color 255,255,255,255

do
d3d_starttext
D3D_Text 2,200,200,2,"How do I make this text Opaque?"
wait key
D3D_Text 2,200,200,2,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
d3d_endtext
Sync
loop

This shows what i mean, the text is transparent and there doesnt seem to be a flag to set to opaque...

Rais
23
Years of Service
User Offline
Joined: 7th Jul 2003
Location:
Posted: 14th Sep 2011 21:39
Ok, im not quite sure what your trying to do here as that code looks wrong. you wont see the first piece of text appear untill it runs the d3d_endtext, as thats after the waitkey and the 2nd line of text your seeing all mixed together.

try this, is this what your expecting?
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Sep 2011 14:37
Do you mean you want an opaque background behind the text?

If so you might need to add a d3d_box behind the text. You can determine the size of the box required using the text width and text height commands in d3d.

Login to post a reply

Server time is: 2026-07-10 08:26:26
Your offset time is: 2026-07-10 08:26:26