Thanks. I got it to work.
Working on another part the elevator trim. So I have it draw a rectangle it is the center.
I have it get the elevator trim. But it seems this value is 0-1. So do I get negative trim?
On drawing the trim bar I guess I need to adjust the y values.
Also can you display text? Like it you had a box for Gear. And you want if Gear up then show "GEAR up"
Working on another part the elevator trim. So I have it draw a rectangle it is the center.
I have it get the elevator trim. But it seems this value is 0-1. So do I get negative trim?
On drawing the trim bar I guess I need to adjust the y values.
Code:
void RANGER1::RedrawPanel_Fuelstatus(SURFHANDLE surf, int part)
{
//SURFHANDLE const tex3 = oapiGetTextureHandle(meshhg_VC,5 );
char cbuf[20];
HDC hDC = oapiGetDC(surf);
double level = GetThrusterLevel(th_main[0]);
double level2 = GetPropellantMass(tank);
double level3 = GetThrusterLevel(th_hover[0]);
double trim = GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM);
SelectObject(hDC, g_Param.hBrush[4]);//green box
Rectangle(hDC, 150, 144, (int)(150 + level * (351 - 150)), 187);//thrust
Rectangle(hDC, 150, 217, (int)(150 + level3 * (350 - 150)), 260);//thrust
Rectangle(hDC, 152, 70, (int)(152.0 + (level2 / 52)), 108); //fuel
Rectangle(hDC, 312, 343, 333, 349); //TRIM
SelectObject(hDC, g_Param.hFont[3]);
SetTextColor(hDC, RGB(0, 153, 0));
SetTextAlign(hDC, TA_LEFT);
SetBkMode(hDC, TRANSPARENT);
sprintf(cbuf, "%0.1f", trim);
TextOut(hDC, 390, 325, cbuf, strlen(cbuf));
oapiReleaseDC(surf, hDC);
}
Also can you display text? Like it you had a box for Gear. And you want if Gear up then show "GEAR up"
Last edited: