Results 1 to 12 of 12
  1. #1
    Dead 4 Real's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Canada
    Posts
    336
    Reputation
    11
    Thanks
    83
    My Mood
    Relaxed

    Resizing a sprite?

    How would you resize the sprite in whit's Combined base v2? i am just wondering thanks.

  2. #2
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Make a new sprite

  3. #3
    NOOB's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    3,843
    Reputation
    425
    Thanks
    8,616
    Delete half the bytes to make the sprite half its size.

  4. #4
    Dead 4 Real's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Canada
    Posts
    336
    Reputation
    11
    Thanks
    83
    My Mood
    Relaxed
    Alright thanks!

  5. #5
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted
    or don't use sprites? and draw it another way?

  6. #6
    Dead 4 Real's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Canada
    Posts
    336
    Reputation
    11
    Thanks
    83
    My Mood
    Relaxed
    Not so sure, but basicly what i was asking how could i resize the image/sprite whit used on combined base v2

  7. #7
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    720
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy
    Quote Originally Posted by ᴺᴼᴼᴮ View Post
    Delete half the bytes to make the sprite half its size.
    NO YO DONT YOU MAKE THE Z AXIS FAARTHER AWAY AND ITS SMALLER CAUSE ITS FARTHER AWAY



    Put this image in your signature if you support HTML5 development!

  8. #8
    dean-wingess's Avatar
    Join Date
    Jan 2009
    Gender
    male
    Posts
    409
    Reputation
    29
    Thanks
    213
    My Mood
    Stressed
    wtf create a new one make it 2x2[x*33/23*2:2:2:2^] should be supported xD
    [YOUTUBE]e89lqiE0wi0[/YOUTUBE]

  9. #9
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    720
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy
    Quote Originally Posted by dean-wingess View Post
    wtf create a new one make it 2x2[x*33/23*2:2:2:2^] should be supported xD
    Yeah everyone knows what that means.



    Put this image in your signature if you support HTML5 development!

  10. #10
    Gordon`'s Avatar
    Join Date
    Dec 2007
    Gender
    male
    Posts
    283
    Reputation
    24
    Thanks
    325
    thats how im doing it

    Code:
    void CSprite::render()
    {
    	D3DXMATRIX matrix;
    	m_sprite->GetTransform(&matrix);
    
    	D3DXVECTOR2 translation = D3DXVECTOR2((FLOAT)m_iCurX, (FLOAT)m_iCurY);
    	D3DXVECTOR2 scale = D3DXVECTOR2((FLOAT)m_fScaleFactorX, (FLOAT)m_fScaleFactorY);
    	D3DXVECTOR2 scalecenter = D3DXVECTOR2((FLOAT)m_iCurW/2, (FLOAT)m_iCurH/2);
    
    	D3DXMatrixTransformation2D(&matrix, &scalecenter, 0, &scale, 0, 0, &translation);
    
    	m_sprite->SetTransform(&matrix);
    
    	m_sprite->Begin(D3DXSPRITE_SORT_TEXTURE);
    	m_sprite->Draw(m_tex, 0, 0, 0, D3DCOLOR_ARGB(m_iCurAlpha, 255, 255, 255));
    	m_sprite->End();
    }


  11. The Following 4 Users Say Thank You to Gordon` For This Useful Post:

    c0ke187 (02-04-2011),Dead 4 Real (01-17-2011),NOOBJr (01-17-2011),_Fk127_ (01-17-2011)

  12. #11
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by Gordon` View Post
    thats how im doing it

    Code:
    void CSprite::render()
    {
    	D3DXMATRIX matrix;
    	m_sprite->GetTransform(&matrix);
    
    	D3DXVECTOR2 translation = D3DXVECTOR2((FLOAT)m_iCurX, (FLOAT)m_iCurY);
    	D3DXVECTOR2 scale = D3DXVECTOR2((FLOAT)m_fScaleFactorX, (FLOAT)m_fScaleFactorY);
    	D3DXVECTOR2 scalecenter = D3DXVECTOR2((FLOAT)m_iCurW/2, (FLOAT)m_iCurH/2);
    
    	D3DXMatrixTransformation2D(&matrix, &scalecenter, 0, &scale, 0, 0, &translation);
    
    	m_sprite->SetTransform(&matrix);
    
    	m_sprite->Begin(D3DXSPRITE_SORT_TEXTURE);
    	m_sprite->Draw(m_tex, 0, 0, 0, D3DCOLOR_ARGB(m_iCurAlpha, 255, 255, 255));
    	m_sprite->End();
    }
    Thanks for sharing i think scaling is the best for this :P
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  13. #12
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,409
    My Mood
    In Love
    Make a new sprite = best
    No I do not make game hacks anymore, please stop asking.