Results 1 to 5 of 5
  1. #1
    KissU's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    107
    Reputation
    10
    Thanks
    14
    My Mood
    Blah

    Post Drawing 2D Sprites in Menu!

    Hey guys, In this thread I'll show how to draw sprites using DirectX
    It's simple and easy.So lets to the code:
    For first create a header file and put the bytes of your image:
    Code:
    BYTE bMyImage[] = { //Bytes here :p };
    Now go on your header file that you put your functions and write this:
    Code:
    //On includes
    #include "MyHeader.h"
    
    //Now the texture variable
    LPDIRECT3DTEXTURE9 g_pDonutTexture; 
    
    void loadTexture( LPDIRECT3DDEVICE9 pDevice )
    {
    D3DXCreateTextureFromFileInMemoryEx(pDevice, //Our D3D9 DevicebMyImage, //Bytes to writesizeof(bMyImage), //Right size of data writen135, //Width100, //HeightD3DX_DEFAULT,/* number of mip-map levels to create 1 = just original texture */0, //Is used yo the driver know *how the data is intended to be used.*D3DFMT_UNKNOWN,//The format set unknow for dont have trouble with 16-bit/32-bit/64-bitD3DPOOL_MANAGED,// Is used to tell the driver where the data should be be stored.//The MANEGED means that the API will keep a copy of the resource in system memory so it can quicly restore the memory.*D3DX_DEFAULT, //If the primitive has a texture, Direct3D must use that texture to produce a color for each pixel in the primitive's 2D rendered image.*D3DX_DEFAULT, //Set the Direct3D minification mipmap filter.*0, //The color (ALPHA,RED,GREEN,BLUE) Leave zero for our texture nice color!NULL,//No infoNULL, //The color pallet :X*&g_pDonutTexture //Our texture :o ?);//Texture filtering-* * pDevice->SetSamplerState(0, D3DSAMP_MINFILTER, *D3DTEXF_ANISOTROPIC);	pDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_ANISOTROPIC);	pDevice->SetSamplerState( 0, D3DSAMP_MIPFILTER, *D3DTEXF_ANISOTROPIC );}
    So know that we have the function go to your file that render the menu, on the present
    When you're showing menu put this:
    Code:
    //At Globals variables
    LPD3DXSPRITE g_pDonutSprite;
    D3DXVECTOR3 SpritePos;
    
    //On Present
    
    loadTexture(pDevice); //Load our function
    SpritePos.x = 100.0f; //X Position on screen
    SpritePos.y = 50.0f; //Y Position on screen
    SpritePos.z = 0.0f;  //The Z Pos Leave zero its 2D
    D3DXCreateSprite( pDevice, &g_pDonutSprite ); //Create our sprite
    g_pDonutSprite->Begin( D3DXSPRITE_ALPHABLEND ); //Enables alpha-blending
    g_pDonutSprite->Draw
    ( g_pDonutTexture, //The texture for sprites
      0, //Not using rect
      0, //Blah
      &SpritePos,//Sprite pos
      D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f) //Leave like this for dont loose colors of texture
    );
    
    g_pDonutSprite->End(); //Our end too :D
    Almost ending, just for finish I will put as attachment the FileToByteArray program
    If you see any erros on post just tell me and I fix :D If you like prass the Thanks button :D
    Good Luck :) Oh, almost forgeting
    Credits to : Google , MPGH - MultiPlayer Game Hacking - Hacks, Cheats, Trainers, Downloads, Combat Arms Hacks, CrossFire Hacks, Medal of Honor Hacks, Black OPS Hacks, Project Blackout Hacks, WarRock Hacks, Soldier Front Hacks, Sudden Attack Hacks, Operation 7 Hacks, AVA H
    Vir scans: VirusTotal - Free Online Virus, Malware and URL Scanner
    FileToByteArray.rar - Verificador de malware do Jotti

    <b>Downloadable Files</b> Downloadable Files
    Last edited by KissU; 11-07-2011 at 10:37 AM.
    "More suicides in world make there are less suicides in the world"


  2. The Following 11 Users Say Thank You to KissU For This Useful Post:

    amzTwEaK (04-14-2014),angerycheats (02-07-2018),brhvitor6 (02-05-2014),Code[VB] (11-19-2011),Fyrwenn (01-26-2013),goold1 (08-15-2013),MageLeif (07-31-2013),Neaglezzz (05-06-2012),Ryuzaki™ (05-12-2013),znoen (12-23-2014),™~jpagz~™ (05-31-2014)

  3. #2
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Good work.
    No idea who approved it tho !

  4. #3
    KissU's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    107
    Reputation
    10
    Thanks
    14
    My Mood
    Blah
    Lol? And I'm thinking "hoho Hassan approved it fast , but no comments D:"
    "More suicides in world make there are less suicides in the world"


  5. #4
    Code[VB]'s Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    CODER
    Posts
    608
    Reputation
    11
    Thanks
    702
    My Mood
    Bitchy
    nice work! thx

  6. #5
    KissU's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    107
    Reputation
    10
    Thanks
    14
    My Mood
    Blah
    Im happy for your using it
    "More suicides in world make there are less suicides in the world"


Similar Threads

  1. DirectX drawing 2D sprites STUPID EXCEPTION
    By PsychicSounds in forum C++/C Programming
    Replies: 9
    Last Post: 05-08-2011, 09:16 AM
  2. [help] como adicionar Sprite no menu do hack
    By kleiton in forum Combat Arms Brazil Help
    Replies: 45
    Last Post: 03-03-2011, 06:42 PM
  3. [RELEASE] How To Draw Sprites
    By ac1d_buRn in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 37
    Last Post: 10-12-2010, 05:50 AM
  4. Help With Menu Sprites
    By AnoNimTeck in forum Art & Graphic Design
    Replies: 2
    Last Post: 10-05-2010, 03:17 PM
  5. [Help] Menu Sprite Disappear
    By Dominic95 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 11
    Last Post: 09-26-2010, 08:26 PM

Tags for this Thread