Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Rotate and translate shader output sprite  (Read 1271 times)

0 Members and 1 Guest are viewing this topic.

Predator106

  • Newbie
  • *
  • Posts: 43
    • View Profile
Rotate and translate shader output sprite
« on: December 07, 2012, 04:32:45 am »
I have an issue that i have a tilemap where i want it to be rendered only in multiples of 16, even if the screen is not as such. So as a result, i have a 4 px (900 % 16 == 4) result on the top. I wanted to move the tilemap up 4 px to hide that..how do i do this?

i tried:

    sf::Transform transform;
    transform.rotate(50.0f);
    sf::RenderStates state;
    state.shader = &m_shader;
    state.transform = transform;
    m_window->draw(m_tileMapFinalSprite, state);
 

hoping that it could rotate the result, but that doesn't work. which means that it won't be able to translate the y value either..

so, i need to move the output up. I tried moving the sprite, but this results in cutting it off, not actually moving anything..

 

anything