EMO Style ForumPro - Hos Geldiniz
 [Coding] - Another D3D menu example Uyeols10

Join the forum, it's quick and easy

EMO Style ForumPro - Hos Geldiniz
 [Coding] - Another D3D menu example Uyeols10
EMO Style ForumPro - Hos Geldiniz
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 203 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: crayzboy76

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Anahtar-kelime

pointer  kutu  loot  

Kimler hatta?
Toplam 9 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 9 Misafir

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
 [Coding] - Another D3D menu example I_icon_minitimeCuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
 [Coding] - Another D3D menu example I_icon_minitimeCuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
 [Coding] - Another D3D menu example I_icon_minitimeÇarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
 [Coding] - Another D3D menu example I_icon_minitimePtsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
 [Coding] - Another D3D menu example I_icon_minitimeC.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
 [Coding] - Another D3D menu example I_icon_minitimeÇarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
 [Coding] - Another D3D menu example I_icon_minitimeÇarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
 [Coding] - Another D3D menu example I_icon_minitimeÇarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
 [Coding] - Another D3D menu example I_icon_minitimePtsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

[Coding] - Another D3D menu example

Aşağa gitmek

 [Coding] - Another D3D menu example Empty [Coding] - Another D3D menu example

Mesaj tarafından Hello EMO Cuma Ara. 10, 2010 2:36 am

The basic "method" for this menu came from my second attempt at making a menu, I was pokin around and seen this source and thought I would clean it up a bit and post it.



Intro/Info and global vars:


Read here

Kod:
 ////////////////////////////////////////////////
/*
PAY ATTENTION

Drawing functions:
void    FillRectD3D(int x, int y, int iWidth, int iHeight, DWORD dwColor);
void    DrawBox(int StartX, int StartY, int Width, int Height, DWORD dwColor);
void    DrawTextD3D(int x, int y, DWORD dwColor, char* szText, DWORD format, bool bEspFont = false);

For your coding pleasure you will have to find your own way to draw d3d, however drawbox is just 4 fillrect's in a box shape.

Comments have been added accordingly, and dont hate on the codes :)

*/
///////////////////////////////////////////////


//Global variables     
bool showMenu    = false;

int iEntries    = 0;
int MenuRectH    = 0;
int MenuRectW    = 120;

/*
You could do something like

#define iNameTags MenuVal[1]
*/
int MenuVal[100];
int MenuColor[100];
int MenuMin[100];
int MenuMax[100];
int MenuInc[100];

Now on with the menu class:

Kod:
class cMenu
{
public:
    void DrawBack(int x, int y, int width, int height, bool bordered, DWORD dwBackCol, DWORD dwBorderCol);
    void Drawtitle(char * Title, DWORD dwtitleCol);
    void AddMember(int x, int y, char * Name, int MinVal, int MaxVal, int Increment);
    void CheckKeys();
    int MenuXPos;
    int MenuYPos;

private:
    int MenuX, MenuY;
    int MenuW, MenuH;
    int MenuSelected;
    void AssignColors();
    void End();
};

Continuing with the functions:

Kod:
void cMenu::DrawBack(int x, int y, int width, int height, bool bordered, DWORD dwBackCol, DWORD dwBorderCol)
{
    MenuX = x;
    MenuY = y;
    MenuW = width;
    MenuH = height;

    Renderer.FillRectD3D(x, y, width, height, dwBackCol);

    if(bordered == true)
        Renderer.DrawBox(x, y, width, height, dwBorderCol);
}



//This will draw a title in the correct place without much hassle :>
void cMenu::Drawtitle(char * Title, DWORD dwtitleCol)
{
    Renderer.DrawTextD3D(MenuX + (MenuW / 2), MenuY + 2, dwtitleCol, Title, DT_CENTER, 0);
}


//There's a lot going on past this point, i know
void cMenu::AddMember(int x, int y, char * Name, int MinVal, int MaxVal, int Increment)
{
    iEntries++;

    //X and Y are offsets from the menu origin
    x = MenuX + x;
    y = MenuY + y;


    //Store this entry's parameters in an array
    MenuMin[iEntries] = MinVal;
    MenuMax[iEntries] = MaxVal;
    MenuInc[iEntries] = Increment;

    //MenuVal[iEntries] stores, well, this entry's value
    char cVal[5];
    sprintf(cVal, "%i", MenuVal[iEntries]);

    //Box that goes around the menu val
    Renderer.DrawBox(x - 4, y - 1, 16, 14, MenuColor[iEntries]);

  //Draw the menu value
    Renderer.DrawTextD3D(x + 4, y, MenuColor[iEntries], cVal, DT_CENTER, 0);

  //Draw the entry name
    Renderer.DrawTextD3D(x + 20, y - 1, MenuColor[iEntries], Name, 0, 0);
}


//As you can see here, move the menu selection and variables with the arrow keys
void cMenu::CheckKeys()
{
    if(GetAsyncKeyState(VK_UP)&1)
        if(MenuSelected > 1)
            MenuSelected--;

    if(GetAsyncKeyState(VK_DOWN)&1)
        if(MenuSelected < iEntries)
            MenuSelected++;

    if(GetAsyncKeyState(VK_RIGHT)&1)
    {
        if(MenuVal[MenuSelected] < MenuMax[MenuSelected])
            MenuVal[MenuSelected] += MenuInc[MenuSelected];
        if(MenuVal[MenuSelected] > MenuMax[MenuSelected])
            MenuVal[MenuSelected] = MenuMax[MenuSelected];
    }

    if(GetAsyncKeyState(VK_LEFT)&1)
    {
        if(MenuVal[MenuSelected] > 0)
            MenuVal[MenuSelected] -= MenuInc[MenuSelected];
        if(MenuVal[MenuSelected] < 0)
            MenuVal[MenuSelected] = 0;
    }

    if(MenuSelected < 1)
        MenuSelected = 1;

  //Keep the code sort-of organized
    cMenu::AssignColors();
    cMenu::End();
}

//Loop through all the menu entries and color them accordingly
void cMenu::AssignColors()
{
    for(int mc = 0; mc < (iEntries + 1); mc++)
    {
        if(MenuSelected == mc)
            MenuColor[mc] = 0xFF00FF00;
        else
            MenuColor[mc] = 0xFFFF0000;
    }
}

//Set the height for the menu background and reset the entry number for the next frame
void cMenu::End()
{
    MenuRectH = iEntries * 25;
    iEntries = 0;
}

I wouldn't forget to show you how its used


//Example usage


cMenu CMenu;


Kod:
void DoMenu()
{
    if(GetAsyncKeyState(VK_DELETE)&1) showMenu = !showMenu;

    if(showMenu == true)
    {
        CMenu.DrawBack(50, 200, 160, MenuRectH, true, D3DCOLOR_ARGB(220, 50, 50, 50), 0xFFFF0000);
        CMenu.AddMember(25, 20, "ESP Name",            0, 1, 1);
        CMenu.AddMember(25, 35, "ESP Health",        0, 1, 1);
        CMenu.AddMember(25, 50, "Chams",            0, 1, 1);
        CMenu.AddMember(25, 65, "Uc-Forum",            0, 1, 1);
        CMenu.CheckKeys();
    }
}

RESULT:
(the gray background is from a test app)

 [Coding] - Another D3D menu example Menuresultpw1

If you use it I would appreciate thanking me




















Hello EMO
Hello EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 935
Puan : 384393
Rep Puanı : 18
Doğum tarihi : 28/11/89
Kayıt tarihi : 21/07/09
Yaş : 34
Nerden : EMO WorlD
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

https://emostyle.yetkinforum.com

Sayfa başına dön Aşağa gitmek

Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz