Exemplo n.º 1
0
Arquivo: tool.cpp Projeto: JRevel/src
void Tool::update(const PlayerController &event)
{
    updateTool(event);
    if(event.pressed(SELECT) && isInside(event.mousePos()))
    {
        if(m_selected)
            m_player = (m_player+1)%m_players.size();
        else
        {
            select();
        }
    }
}
Exemplo n.º 2
0
Arquivo: tool.cpp Projeto: JRevel/src
void Tool::draw(sf::RenderTarget &render, const PlayerController &event) const
{
    drawRect(render, getPos(), m_dim, sf::Color::Black, 1, m_selected ? getPlayer()->getBaseColor() : (isInside(event.mousePos()) ? sf::Color(150, 150, 150, 255) : sf::Color(100, 100, 100, 255)));
}
Exemplo n.º 3
0
void GuiButton::update(const PlayerController &controller, Vec pos, Vec dim)
{
    m_hovered = controller.mousePos().insideRect(pos, dim);
}