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

Show Posts

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.


Messages - Damian

Pages: [1]
1
Graphics / Just to be sure. Does SFML use OpenGL for render shapes?
« on: September 03, 2011, 07:45:05 pm »
Yes you can ;)

2
Graphics / Tile map with collision?
« on: September 02, 2011, 12:38:06 pm »
Hello. I have question that comes with title ;d I know how to make a tilemap but how to detect collision with sprites of Tilemap. ? And i know how to detect normal collision but how to do it with tile map ?:(

Please help

And i dont want ready code. Just explanation.

3
Graphics / click on sprite
« on: August 30, 2011, 05:14:35 pm »
Ok. Thanks ;)

4
Graphics / click on sprite
« on: August 30, 2011, 04:58:55 pm »
Code: [Select]

bool isSpriteClicked ( sf::Sprite *spr, sf::RenderWindow *render )
{
const sf::Input& Input = render->GetInput();
if( Input.GetMouseX() > spr->GetPosition().x
&& Input.GetMouseX() < spr->GetPosition().x + spr->GetSize().x
&& Input.GetMouseY() > spr->GetPosition().y && Input.GetMouseY() < spr->GetPosition().y + spr->GetSize().y
&& Input.IsMouseButtonDown(sf::Mouse::Left)
)
{
return true;
}
else
{
return false;
}
}


Usage:
Code: [Select]

if(isSpriteClicked( &YOUR_SPRITE, &Window ))
{
// Example:
Window.Close();
}


It should work correctly with SFML 1.6 and VS 2008/2010

I helped you. But i see that you dont have any idea on game prgramming ;). At first you must know C++ better and Do some console games (CLI). Text based. Dont try make 2d/3d games right now! Learn at first!

Pages: [1]
anything