LooiWindow.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:AutonomousCar 作者:
private void paint()
{

    BufferStrategy bs = canvas.getBufferStrategy();
    if(bs == null)
        {
            canvas.createBufferStrategy(3);
            return;
        }
    g = bs.getDrawGraphics();

    g.clearRect(0,0,(int)getWindowWidth(),(int)getWindowHeight());

    for(int i = paintActiveLooiObjects.size()-1; i > -1 ; i--)
        {
            paintActiveLooiObjects.get(i).setGraphics(g);
            g.setColor(Color.black);//set default color here! omg it used to be yellow and I had no idea... and i was so confused y everything was YELLOW
            paintActiveLooiObjects.get(i).looiPaint();
        }



    g.setColor(Color.black);
    g.fillRect(0,0,getWindowWidth(),viewVerticalOffset);
    g.fillRect(0,viewHeight+viewVerticalOffset,getWindowWidth(),getWindowHeight());
    g.fillRect(0,0,viewHorizontalOffset,getWindowHeight());
    g.fillRect(viewWidth+viewHorizontalOffset,0,getWindowWidth(),getWindowHeight());

    bs.show();
    g.dispose();
    //g.finalize();//This line gives the program a TINY performance boost
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号