コード例 #1
0
  public void draw(RenderHelper renderer) {
    Texture texture;
    if (m_pressed && !m_is_disabled) {
      texture = m_texture_pressed;
    } else {
      texture = m_texture_unpressed;
    }

    float[] default_color = m_color;
    if (m_is_disabled) {
      float[] font_color = m_item_font.getColor();
      for (int i = 0; i < 4; ++i) m_tmp_color[i] = font_color[i];
      m_item_font.setColor(m_color_disabled);
      m_color = m_color_disabled;
    }

    renderer.pushModelMat();
    renderer.modelMatTranslate(m_position.x, m_position.y, 0.f);
    renderer.modelMatScale(m_size.x, m_size.y, 0.f);

    drawTexture(renderer, texture);

    // Render font
    m_item_font.draw(renderer);

    if (m_is_disabled) {
      m_color = default_color;
      m_item_font.setColor(m_tmp_color);
    }

    renderer.popModelMat();
  }
コード例 #2
0
  public void draw(RenderHelper renderer) {
    renderer.pushModelMat();
    renderer.modelMatTranslate(m_position.x, m_position.y, 0.f);
    renderer.modelMatScale(m_size.x, m_size.y, 0.f);

    drawTexture(renderer, m_texture);

    m_item_font.draw(renderer);

    renderer.popModelMat();
  }
コード例 #3
0
  public void draw(RenderHelper renderer) {
    renderer.pushModelMat();
    renderer.modelMatTranslate(m_position.x, m_position.y, 0.f);
    renderer.modelMatScale(m_size.x, m_size.y, 0.f);

    if (m_is_selected) drawTexture(renderer, m_selected_texture);
    else drawTexture(renderer, m_normal_texture);

    m_item_font.draw(renderer);

    renderer.popModelMat();
  }