openla/src/dllmain.cpp
// Draw a specific text at xy (local screen space) with the specified scale (too)
Draw a specific text at xy (local screen space) with the specified scale (too)
Draw a specific text at xy ( local screen space ) with the specified scale ( too )
void DrawText(const char* text, float x, float y, float scalex, float scaley)
{
    struct CRGBA
    {
        unsigned char red, green, blue, alpha;
        CRGBA() {}
        CRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a) :
            red(r), green(g), blue(b), alpha(a)
        {}
    };
    static void* pInterfaceColour                                           = injector::lazy_pointer<0xBAB22C>::get();   
    static void* pGetInterfaceColour                                        = injector::lazy_pointer<0x58FEA0>::get();   
    static int*  pRsGlobal                                                  = injector::lazy_pointer<0xC17040>::get();   
    static void (*SetScale)(float w, float h)                               = injector::lazy_pointer<0x719380>::get();   
    static void (*SetColor)(void* color)                                    = injector::lazy_pointer<0x719430>::get();    // would work because sizeof(CRGBA) == sizeof(void*)
    static void (*SetFontStyle)(short style)                                = injector::lazy_pointer<0x719490>::get();   
    static void (*SetDropColor)(CRGBA color)                                = injector::lazy_pointer<0x719510>::get();   
    static void (*SetEdge)(short value)                                     = injector::lazy_pointer<0x719590>::get();   
    static void (*SetProportional)(bool on)                                 = injector::lazy_pointer<0x7195B0>::get();   
    static void (*SetBackground)(bool background, bool backgroundOnlyText)  = injector::lazy_pointer<0x7195C0>::get();   
    static void (*SetJustify)(bool on)                                      = injector::lazy_pointer<0x719600>::get();   
    static void (*SetRightJustifyWrap)(float value)                         = injector::lazy_pointer<0x7194F0>::get();   
    static void (*SetWrapx)(float value)                                    = injector::lazy_pointer<0x7194D0>::get();   
    static void (*SetOrientation)(int alignment)                            = injector::lazy_pointer<0x719610>::get();   
    static void (*PrintString)(float x, float y, const char *text)          = injector::lazy_pointer<0x71A700>::get();   
	CRGBA rgba;
	((CRGBA* (__thiscall *)(void*, CRGBA*, unsigned char))pGetInterfaceColour)(pInterfaceColour, &rgba, 4);
    float screenx((float)((signed int)*(pRsGlobal + 1)) / 640.0f);
    float screeny((float)((signed int)*(pRsGlobal + 2)) / 448.0f);
    SetFontStyle(1); 
    SetJustify(0);
    SetBackground(0, 0);
    SetProportional(true);
    SetOrientation(1);
    SetRightJustifyWrap(0);
    SetWrapx(640.0f * screenx);
    SetEdge(1);
    SetDropColor(CRGBA(0, 0, 0, 0xFF));
    SetColor(*(CRGBA**)&rgba);
    SetScale(screenx * scalex, screeny * scaley);
    PrintString(screenx * x, screeny * y, text);
}
void DrawText ( const char * text , float x , float y , float scalex , float scaley ) { struct CRGBA { unsigned char red , green , blue , alpha ; CRGBA ( ) { } CRGBA ( unsigned char r , unsigned char g , unsigned char b , unsigned char a ) : red ( r ) , green ( g ) , blue ( b ) , alpha ( a ) { } } ; static void * pInterfaceColour = injector :: lazy_pointer < 0xBAB22C > :: get ( ) ; static void * pGetInterfaceColour = injector :: lazy_pointer < 0x58FEA0 > :: get ( ) ; static int * pRsGlobal = injector :: lazy_pointer < 0xC17040 > :: get ( ) ; static void ( * SetScale ) ( float w , float h ) = injector :: lazy_pointer < 0x719380 > :: get ( ) ; static void ( * SetColor ) ( void * color ) = injector :: lazy_pointer < 0x719430 > :: get ( ) ; static void ( * SetFontStyle ) ( short style ) = injector :: lazy_pointer < 0x719490 > :: get ( ) ; static void ( * SetDropColor ) ( CRGBA color ) = injector :: lazy_pointer < 0x719510 > :: get ( ) ; static void ( * SetEdge ) ( short value ) = injector :: lazy_pointer < 0x719590 > :: get ( ) ; static void ( * SetProportional ) ( bool on ) = injector :: lazy_pointer < 0x7195B0 > :: get ( ) ; static void ( * SetBackground ) ( bool background , bool backgroundOnlyText ) = injector :: lazy_pointer < 0x7195C0 > :: get ( ) ; static void ( * SetJustify ) ( bool on ) = injector :: lazy_pointer < 0x719600 > :: get ( ) ; static void ( * SetRightJustifyWrap ) ( float value ) = injector :: lazy_pointer < 0x7194F0 > :: get ( ) ; static void ( * SetWrapx ) ( float value ) = injector :: lazy_pointer < 0x7194D0 > :: get ( ) ; static void ( * SetOrientation ) ( int alignment ) = injector :: lazy_pointer < 0x719610 > :: get ( ) ; static void ( * PrintString ) ( float x , float y , const char * text ) = injector :: lazy_pointer < 0x71A700 > :: get ( ) ; CRGBA rgba ; ( ( CRGBA * ( __thiscall * ) ( void * , CRGBA * , unsigned char ) ) pGetInterfaceColour ) ( pInterfaceColour , & rgba , 4 ) ; float screenx ( ( float ) ( ( signed int ) * ( pRsGlobal + 1 ) ) / 640.0f ) ; float screeny ( ( float ) ( ( signed int ) * ( pRsGlobal + 2 ) ) / 448.0f ) ; SetFontStyle ( 1 ) ; SetJustify ( 0 ) ; SetBackground ( 0 , 0 ) ; SetProportional ( true ) ; SetOrientation ( 1 ) ; SetRightJustifyWrap ( 0 ) ; SetWrapx ( 640.0f * screenx ) ; SetEdge ( 1 ) ; SetDropColor ( CRGBA ( 0 , 0 , 0 , 0xFF ) ) ; SetColor ( * ( CRGBA * * ) & rgba ) ; SetScale ( screenx * scalex , screeny * scaley ) ; PrintString ( screenx * x , screeny * y , text ) ; }
Draw a specific text at xy (local screen space) with the specified scale (too)
Draw a specific text at xy ( local screen space ) with the specified scale ( too )
// CRGBA structure // Game method pointers // For GetInterfaceColour // For GetInterfaceColour // To find the resolution // CFont method // CFont method // would work because sizeof(CRGBA) == sizeof(void*) // CFont method // CFont method // CFont method // CFont method // CFont method // CFont method // CFont method // CFont method // CFont method // CFont method // Gets the interface colour for the text // Transformer from global screen space to local screen space // Setup the font style // Print the text