/** @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, int) */
 public void update(GameContainer container, int delta) {
   int mx = container.getInput().getMouseX();
   int my = container.getInput().getMouseY();
   try {
     Color c = image.getColor(mx, my);
     System.out.println(c.getRed() + " " + c.getBlue() + " " + c.getGreen());
   } catch (Exception e) {
   }
 }
Пример #2
0
    public void Render(Coord dc) {
      double t = (float) (System.currentTimeMillis() - start_time) / (float) LIFE_TIME;
      int a = FlyParam.GetAlpha(t);
      int dy = FlyParam.GetY(t);
      Color c = getColor();

      Render2D.Text(
          "default",
          dc.x - Render2D.GetTextWidth("default", msg) / 2,
          dc.y - dy - 85,
          msg,
          new Color(c.getRed(), c.getGreen(), c.getBlue(), a));
    }
Пример #3
0
 /**
  * A convenience method to <i>put</i> a given pixel's color using Slick's color class. See the
  * other putPixel method for details.
  *
  * @param rgba the RGBA components of the pixel
  */
 public PixelData putPixel(Color rgba) {
   return putPixel(rgba.getRed(), rgba.getGreen(), rgba.getBlue(), rgba.getAlpha());
 }
Пример #4
0
 /**
  * A convenience method to set a given pixel's color using Slick's color class. See the other
  * setPixel method for details.
  *
  * @param x the x position of the pixel
  * @param y the y position of the pixel
  * @param rgba the RGBA components of the pixel
  * @see setPixel(int x, int y, int r, int g, int b, int a)
  */
 public void setPixel(int x, int y, Color rgba) {
   setPixel(x, y, rgba.getRed(), rgba.getGreen(), rgba.getBlue(), rgba.getAlpha());
 }