C++ Question Display Static Text

lethal_d0se

Addon Developer
Addon Developer
Joined
Jan 23, 2010
Messages
15
Reaction score
0
Points
0
Hello all, i've tried searching but to no avail.

How would one go about displaying static test on the screen, much like the key data in the bottom left of an EVA suit or instruction in UCGO. Just without requiring a string or operation.
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,927
Reaction score
795
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
The bottom left? You mean the black text with a white background?

That's a space you can print into by using sprintf(oapiDebugString(), "text"); - check the SDK documentation for information on the function.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,295
Reaction score
3,264
Points
203
Location
Toulouse
This will display the variable "test" on the bottom left of the screen, with 2 decimals and the text "Hail Probe" before it.

Code:
[B]double[/B] test;
test = 2.350348634

sprintf(oapiDebugString(),"Hail Probe %.2f", test);
 

lethal_d0se

Addon Developer
Addon Developer
Joined
Jan 23, 2010
Messages
15
Reaction score
0
Points
0
Thanks, I've managed to get the effect I've been looking for.
 

Wishbone

Clueless developer
Addon Developer
Joined
Sep 12, 2010
Messages
2,421
Reaction score
1
Points
0
Location
Moscow
In most cases using secure version of sprintf (and other i/o functions) is recommended
Code:
 int test = 1;
 sprintf_s(oapiDebugString(), 255, "Comms check %d %d %d", test, test+1, test+2);
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,927
Reaction score
795
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Yeah, Visual Studio keeps telling me that too, and I keep forgetting about it :p
 
Top