Jump to content
Sign in to follow this  
Guest Patrick_Waugh

Help with MAKE_STRING

Recommended Posts

Guest Patrick_Waugh

Having never tried this before, I'm not sure what I'm doing wrong with this macro.#define GAUGE_CHARSET DEFAULT_CHARSET#define GAUGE_FONT_DEFAULT "Courier New"#define GAUGE_WEIGHT_DEFAULT FW_NORMAL CHAR atcID[] = "N001ST";FLOAT64 FSAPI string_cb( PELEMENT_STRING pelement ){ sprintf( pelement->string, "%s", atcID ); return 0;}MAKE_STRING( bac_id_string, NULL, NULL, IMAGE_USE_ERASE | IMAGE_USE_BRIGHT, 0, 2, 1, 87, 24, 6, MODULE_VAR_NONE, MODULE_VAR_NONE, MODULE_VAR_NONE, RGB(112,144,144), RGB(0,0,0), RGB(92,92,92), GAUGE_FONT_DEFAULT, GAUGE_WEIGHT_DEFAULT, GAUGE_CHARSET, 18, DT_CENTER | DT_VCENTER | DT_SINGLELINE, NULL, string_cb)from my code. What am I doing wrong?Patrick

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

Ok, I figured out I had to change the 18 to 0 to allow FS to auto compute the size.I guess if you manually set that, then you have to set the width parameter to be the width of a character vs. width of the background, but I'm still not sure.Patrick

Share this post


Link to post
Share on other sites

>Ok, I figured out I had to change the 18 to 0 to allow FS to>auto compute the size.>>I guess if you manually set that, then you have to set the>width parameter to be the width of a character vs. width of>the background, but I'm still not sure."Specifies the font size for the string. A value of zero (0) means scale so that NUMCHARS capital W's fit into SIZE_X. A non-zero FONT_SIZE means fixed height."I've always used a zero entry here so that the font will rescale automatically regardless of gauge drawing size, etc.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

Thanks Bill.I have a niffty little gauge now that displays my customer's licensed registered aircraft id, and when you mouse over it shows their software key. =)It's kind of cool because each aircraft I sell now will have a unique official aircraft registration number.Eventually, I'll be able to set this up to issue these automatically over the web too.Patrick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...