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 - EIRBLAST

Pages: [1]
1
Graphics / Re: know if an shape is completly inside of an other
« on: October 07, 2018, 01:02:52 am »
I think of that !
But i don't know how to pull it out :/

what do i have to modify it ? should i do it like this ?
    if(MapBody.getGlobalBounds().intersects(sf::Rect.contains(/*What do i put here ?*/))
    {
        return true;
    }
    else
    {
        return false;
 
Because this return a boolean to an other bool, i don't think this a thing x).

2
Graphics / know if an shape is completly inside of an other
« on: October 06, 2018, 10:31:23 pm »
Hello everyone,

I tried to made a way to know if an rectangle shape is completly inside of an other rectangle shape
this is all i can come up with:
bool Map::Limit(const sf::RectangleShape body)
{
    sf::RectangleShape MapBody;
    MapBody.setPosition(MapStartPos.x,MapStartPos.y);
    MapBody.setSize(sf::Vector2f(MapStartPos.x+MapSize.x*TileSize.x,MapStartPos.y+MapSize.y*TileSize.y));

    if(MapBody.getGlobalBounds().intersects(body.getGlobalBounds()))
    {
        return true;
    }
    else
    {
        return false;
    }
}
 
obviously this only work when the "body" is completly outside of the map
Can someone help me please ? thanks !

Pages: [1]