1
Slick에서 상태 표시 줄을 렌더링하려고합니다. 나는 그 앞에 녹색이있는 빨간색 직사각형으로 건강 상태를 보여주고 싶다.Slick - 채워진 직사각형
Rectangle healthBG = new Rectangle(healthX, healthY, healthWidth, healthHeight);
ShapeFill healthFill = new GradientFill(0, healthHeight/2, Color.red, healthWidth, healthHeight - 1, Color.orange, true);
float healthGAWidth = ((float) health/(float) maxHealth) * (float) healthWidth;
Rectangle healthGA = new Rectangle(healthX, healthY, healthGAWidth, healthHeight);
ShapeFill healthGAFill = new GradientFill(0, healthHeight/2, Color.green, healthGAWidth, healthHeight - 1, Color.green, true);
//g.setColor(Color.red);
g.draw(healthBG, healthFill);
//g.setColor(Color.green);
g.draw(healthGA, healthGAFill);
이 화면에 렌더링되는 것입니다 :