예제 #1
0
파일: Mouse.java 프로젝트: fdb/scenebuilder
 @Override
 public void execute(Context context, float time) {
   PApplet applet = context.getApplet();
   pX.set((float) applet.mouseX);
   pY.set((float) applet.mouseY);
   pPreviousX.set((float) applet.pmouseX);
   pPreviousY.set((float) applet.pmouseY);
   pMousePressed.set(applet.mousePressed);
   pMouseButton.set(applet.mouseButton);
 }
예제 #2
0
  @Override
  public int filter(int x, int y, int v) {
    int a = v & 0xff000000;
    int r = (v >> 16) & 0xff;
    int g = (v >> 8) & 0xff;
    int b = v & 0xff;
    r = clamp((int) (r * pRed.get()));
    g = clamp((int) (g * pGreen.get()));
    b = clamp((int) (b * pBlue.get()));

    return a | (r << 16) | (g << 8) | b;
  }