31
General / Re: Weird problem
« on: January 22, 2014, 10:00:26 pm »
Some font present on Window does not work in SFML, try the classical arial.ttf to see if the problem is the same.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
TApp.h
TApp::TApp()
: m_Window(sf::VideoMode(640, 480), "SFML Game Engine")
{
sf::Texture texture; //Problem here!
texture.loadFromFile("sprites/first.bmp");
m_sprite.setTexture(texture);
}
Not really... Where are you checking positions? And why is your min depended on the size?Code: [Select]min.x = playerTexture.getSize().x;
max.y = playerTexture.getSize().y;
AndCode: [Select]
min.x = blockTexture.getSize().x;
max.y = blockTexture.getSize().y;
This is correct, isn't it?
You most likely would want to go with the sprite instead.min = playerSprite.getPosition();
max.x = playerSprite.getGlobalBounds().width;
max.y = playerSprite.getGlobalBounds().height;
Andmin = blockSprite.getPosition();
max.x = blockSprite.getGlobalBounds().width;
max.y = blockSprite.getGlobalBounds().height;
Alternatively you can also use the global bound for the min, just access .top and .left.