i can post how i draw things, but most of that shouldn't matter much for what is happening on one computer right? Maybe something in the window settings though?
sf::WindowSettings Settings;
Settings.DepthBits = 24; // Request a 24 bits depth buffer
Settings.StencilBits = 8; // Request a 8 bits stencil buffer
Settings.AntialiasingLevel = 0; // Request 2 levels of antialiasing
//Create the Window
sf::RenderWindow App(sf::VideoMode(1280, 1024, 32), "SFML Game", sf::Style::Fullscreen, Settings);
//Vertical sync
App.UseVerticalSync(true);
//Load Images
sf::Image Image[8];
//smoothing
for (int i=0; i<8; i++){
Image[i].SetSmooth(true);
}
if (!Image[0].LoadFromFile("Background.png"))
return 0;
sf::Sprite Background;
Background.SetImage(Image[0]);
if (!Image[1].LoadFromFile("InventoryBag.png"))
return 0;
sf::Sprite InventoryBag;
InventoryBag.SetImage(Image[1]);
if (!Image[2].LoadFromFile("Character.png"))
return 0;
sf::Sprite Character;
Character.SetImage(Image[2]);
//Change this
int numberOfIcons = 16;
if (!Image[3].LoadFromFile("InventoryIcons.png"))
return 0;
sf::Sprite InventoryIcon[numberOfIcons];
for (int i = 0; i<numberOfIcons; i++){
InventoryIcon[i].SetImage(Image[3]);
}
if (!Image[4].LoadFromFile("WorldIcons.png"))
return 0;
sf::Sprite WorldIcon[numberOfIcons];
for (int i = 0; i<numberOfIcons; i++){
WorldIcon[i].SetImage(Image[4]);
}
if (!Image[5].LoadFromFile("Tree.png"))
return 0;
sf::Sprite Tree[11];
for (int i = 0; i<11; i++){
Tree[i].SetImage(Image[5]);
}
int numberOfTrees = 11;
if (!Image[6].LoadFromFile("Tree shadow.png"))
return 0;
sf::Sprite TreeShadow[numberOfTrees];
for (int i = 0; i<numberOfTrees; i++){
TreeShadow[i].SetImage(Image[6]);
}
if (!Image[7].LoadFromFile("Cursor.png"))
return 0;
sf::Sprite Cursor[2];
Cursor[0].SetImage(Image[7]);
Cursor[1].SetImage(Image[7]);
Cursor[0].SetSubRect(sf::IntRect(0,0,18,24));
Cursor[1].SetSubRect(sf::IntRect(18,0,49,24));
App.ShowMouseCursor(false);
//Background
App.Draw(Background);
for (int i=numberOfTrees - 1; i>=0; i--){
App.Draw(TreeShadow[i]);
if (character.y >= Tree[i].GetPosition().y)
App.Draw(Tree[i]);
}
//Draw icons in the world
for(int i=0; i<numberOfIcons; i++){
if (worldIcon[i].pickedUp == false && character.y >= WorldIcon[i].GetPosition().y + WorldIcon[i].GetSize().y)
App.Draw(WorldIcon[i]);
}
//Character
App.Draw(Character);
for (int i=numberOfTrees - 1; i>=0; i--){
if (character.y < Tree[i].GetPosition().y)
App.Draw(Tree[i]);
}
//Draw icons in the world
for(int i=0; i<numberOfIcons; i++){
if (worldIcon[i].pickedUp == false && character.y < WorldIcon[i].GetPosition().y + WorldIcon[i].GetSize().y)
App.Draw(WorldIcon[i]);
}
if (inventory == true){
//Inventory
App.Draw(InventoryBag);
//Icons in slots
for (int i = 0; i<16; i++){
if (slot[i].itemNumber != -1)
App.Draw(InventoryIcon[slot[i].itemNumber]);
}
//Draw Icon Text
if (slotMousePos != -1 && slot[slotMousePos].itemNumber != -1)
App.Draw(inventoryIcon[slot[slotMousePos].itemNumber].text);
}
//Icons on mouse
if (itemOnMouse != -1)
App.Draw(InventoryIcon[itemOnMouse]);
if (worldIconMousePos == -1 && inventoryIconMousePos == -1)
App.Draw(Cursor[0]);
else
App.Draw(Cursor[1]);