Guest User

Untitled

a guest
Jan 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1.     sf::Sprite spr;
  2.     spr.SetImage(*MGR_RESOURCE->GetImage(name)); //only singleton left. not even needed
  3.     spr.SetX(dst->Left());
  4.     spr.SetY(dst->Top());
  5.  
  6.     if(src != NULL)
  7.         spr.SetSubRect(sf::IntRect(src->Left(), src->Top()
  8.             , src->Right(), src->Bottom()));
  9.  
  10.     float scaleX = 1.0f + (src->Width() / dst->Width());
  11.     float scaleY = 1.0f + (src->Height() / dst->Height());
  12.  
  13.     spr.SetScaleX(scaleX);
  14.     spr.SetScaleX(scaleY);
  15.  
  16.     mWindow->Draw(spr);
Add Comment
Please, Sign In to add comment