hey i got this funky little code:
if(BagUpdate)
{
for(int a=((pPlayer->get_BagShow())*9);a<((pPlayer->get_BagShow()*9)+9);++a)//18-27=A
{
sf::Sprite bsItem;
sf::Image ibsItem;
ibsItem.LoadFromFile(pPlayer->Bag[a]->get_Sprite());
bsItem.SetImage(ibsItem);
bsItem.SetSubRect(sf::IntRect((pPlayer->Bag[a]->get_Index()*15),0,((pPlayer->Bag[a]->get_Index()*15)+15),15));
bsItem.Resize(15.f/16.f,15.f/16.f);
bsItem.SetPosition(((17.f+(BagSlotX[a]))/16.f),((60.f+(BagSlotY[a]))/16.f));
GameWind.Draw(bsItem);
cout << "Bag updated!" << endl;
}
BagUpdate = false;
}
basically what is does is show the inventory when BagUpdate is true.
the only problem is that when doing so(and this is in the game loop) it only shows the inventory for one frame(and doing this every frame can slow things down alot)
so im wondering if maybe im doing this wrong? if so then could someone help me out?
(again) what im trying to do show all of the sprites of the bag items without slowing the computer down...
im also wondering if its possible to make a small function that maybe pauses this loop automatically(if this is possible then please give an example, it would be nice)
if anyone doesnt understand what im asking or how the function works then reply here to let me know
i will keep this thread as updated as i can with this current status.
thank you for reading, and even more foe helping out.