Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

32
LINES

< > BotCompany Repo | #1005629 - pointArrowsToArea - show (up to) 4 animated arrows on screen pointing to an area

JavaX fragment (include)

static int pointArrowsToArea_inset = 20;
static double pointArrowsToArea_defaultSeconds = 5;

static L<JWindow> pointArrowsToArea(Rect r) {
  ret pointArrowsToArea(r.getRectangle());
}

static L<JWindow> pointArrowsToArea(Rectangle r) {
  ret pointArrowsToArea(r, pointArrowsToArea_defaultSeconds);
}

static L<JWindow> pointArrowsToArea(Rectangle r, double seconds) {
  int midX = r.x+r.width/2, midY = r.y+r.height/2;
  int inset = pointArrowsToArea_inset;
  
  S iLeft = null /* TODO: lost/broken - "#1005637"*/, iDown = "#1005636", iRight = "#1005634", iUp = "#1005635";
  int rInset = -16;

  new L<JWindow> windows;
  BufferedImage img;
  if (iLeft != null) {
    img = loadImage2(iLeft);
    addIfNotNull(windows, freeFloatingAnimation(iLeft, r.x+r.width+inset+rInset, midY-img.getHeight()/2));
  }
  img = loadImage2(iDown);
  addIfNotNull(windows, freeFloatingAnimation(iDown, midX, r.y-inset-img.getHeight()));
  img = loadImage2(iRight);
  addIfNotNull(windows, freeFloatingAnimation(iRight, r.x-inset-img.getWidth(), midY-img.getHeight()/2));
  img = loadImage2(iUp);
  addIfNotNull(windows, freeFloatingAnimation(iUp, midX, r.y+r.height+inset));
  ret disposeWindowsAfter(secondsToMS(seconds), windows);
}

Author comment

Began life as a copy of #1005627

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005629
Snippet name: pointArrowsToArea - show (up to) 4 animated arrows on screen pointing to an area
Eternal ID of this version: #1005629/3
Text MD5: 782199bca04057c62fc9c260350739a2
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-15 04:06:41
Source code size: 1249 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 380 / 362
Version history: 2 change(s)
Referenced in: [show references]