Results 1 to 11 of 11
  1. #1
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    37
    Reputation
    10
    Thanks
    51
    My Mood
    Fine

    Post How to draw sprites in Present

    hey guys i wanna show you how to draw a sprite correctly.
    At first the declarations:

    Code:
    LPDIRECT3DTEXTURE9 SpriteTexture;
    LPD3DXSPRITE Sprite;
    int SpriteSize_X = 100; //Width of your sprite
    int SpriteSize_Y = 100; //Height of your sprite
    Then insert these functions in your Code:

    Code:
    void CreateSprite(LPDIRECT3DDEVICE9 pDevice)
    {
    	{
    		D3DXCreateTextureFromFileInMemoryEx(pDevice, &myFile, sizeof(myFile), SpriteSize_X , SpriteSize_Y, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &SpriteTexture);
    	    D3DXCreateSprite(pDevice,&Sprite);
       }
    }
    
    void DrawSprite(LPDIRECT3DDEVICE9 pDevice){
    	D3DXVECTOR3 POS;
    	POS.x = 5;
    	POS.y = 5;
    	POS.z = 0;
    	if(SpriteTexture==NULL){CreateSprite(pDevice);}
    	Sprite->Begin(D3DXSPRITE_ALPHABLEND); 
    	Sprite->Draw(SpriteTexture,NULL,NULL,&POS,0xFFFFFFFF);
    	Sprite->End();
    }
    myFile is the byte array from your picture (you have to generate it, the program to do this is in the attachments), Example:

    Code:
    BYTE myFile[] = { 0x00, 0x00, ... }
    When your done just insert this in your present:

    Code:
    DrawSprite(pDevice);
    FileToByteArray EXE Virus Scan: https://www.virustotal.com/file/a32b...is/1347228483/

    FileToByteArray RAR Virus Scan #1: https://www.virustotal.com/file/3ee3...is/1347228532/

    FileToByteArray RAR Virus Scan #2: https://www.virustotal.com/file/3ee3...is/1347228580/

    Hope it works and have fun with it

    Credits:
    Me
    <b>Downloadable Files</b> Downloadable Files
    Haters Gon' Hate

  2. The Following 9 Users Say Thank You to RedAppleCoder For This Useful Post:

    'SmoLL (09-10-2012),FR1GHT (09-10-2012),[MPGH]JamesRo (06-05-2013),Otaviomorais (10-02-2012),Ryuzaki™ (09-14-2012),sakinoakura (09-10-2012),street_21 (09-09-2012),thecrank (01-30-2013),[H]aaBX (10-25-2012)

  3. #2
    Shadow`'s Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    MN
    Posts
    643
    Reputation
    74
    Thanks
    2,999
    My Mood
    Relaxed
    Basically the thread ac1d_buRn made a while ago ^^

  4. #3
    street_21's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    450
    Reputation
    -36
    Thanks
    54
    My Mood
    Amazed
    nice
    Respect List:
    @Black Diamond
    @ChaosMagician
    @TokolocoSK

  5. #4
    The Vector's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    39
    My Mood
    Amazed
    Approve?? @EmInem @BACKD00R




    Vector - USS Alpha Team


    Want Talk to Me ?

    email: the_vector@live.com
    Skype: TheVectoor

  6. #5
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    37
    Reputation
    10
    Thanks
    51
    My Mood
    Fine
    Quote Originally Posted by Shadow` View Post
    Basically the thread ac1d_buRn made a while ago ^^
    Yeah maybe he did but i never seen it
    Haters Gon' Hate

  7. #6
    .REZ's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    Real life
    Posts
    10,389
    Reputation
    1110
    Thanks
    2,214
    My Mood
    Psychedelic
    / approved

  8. The Following 2 Users Say Thank You to .REZ For This Useful Post:

    RedAppleCoder (09-10-2012),sakinoakura (09-10-2012)

  9. #7
    sakinoakura's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    2
    My Mood
    Cheerful
    thanks for sharing.

  10. #8
    Nightmare's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    North of Hell
    Posts
    2,399
    Reputation
    149
    Thanks
    6,560
    My Mood
    Worried
    Great job brother.

  11. #9
    Ryuzaki™'s Avatar
    Join Date
    Apr 2011
    Gender
    male
    Location
    At my headquarter, catching KIRA
    Posts
    1,670
    Reputation
    41
    Thanks
    6,165
    My Mood
    Lurking
    Thanks for this
    Last edited by Ryuzaki™; 09-14-2012 at 10:19 AM.



  12. #10
    bobmarleyvav's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    21
    Reputation
    10
    Thanks
    1
    My Mood
    Amazed
    Quote Originally Posted by street_21 View Post
    nice

    Wooow bro u make ?

  13. #11
    street_21's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    450
    Reputation
    -36
    Thanks
    54
    My Mood
    Amazed
    Quote Originally Posted by bobmarleyvav View Post
    Wooow bro u make ?
    sim eu que fiz
    Respect List:
    @Black Diamond
    @ChaosMagician
    @TokolocoSK

Similar Threads

  1. [Request] How to Draw a GUI?
    By CanYouDoIt in forum Combat Arms Coding Help & Discussion
    Replies: 17
    Last Post: 11-18-2010, 02:18 PM
  2. How to draw a textbox
    By wassup40 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 14
    Last Post: 10-20-2010, 09:44 AM
  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, 06:50 AM
  4. [Help]How to draw text from a file?
    By seeplusplus in forum Combat Arms Coding Help & Discussion
    Replies: 29
    Last Post: 10-05-2010, 05:47 PM
  5. How to draw a car in MS
    By AN1MAL in forum Entertainment
    Replies: 9
    Last Post: 12-18-2006, 06:38 PM

Tags for this Thread