1 | static int pointArrowsToArea_inset = 20; |
2 | static double pointArrowsToArea_defaultSeconds = 5; |
3 | |
4 | static L<JWindow> pointArrowsToArea(Rect r) { |
5 | ret pointArrowsToArea(r.getRectangle()); |
6 | } |
7 | |
8 | static L<JWindow> pointArrowsToArea(Rectangle r) { |
9 | ret pointArrowsToArea(r, pointArrowsToArea_defaultSeconds); |
10 | } |
11 | |
12 | static L<JWindow> pointArrowsToArea(Rectangle r, double seconds) { |
13 | int midX = r.x+r.width/2, midY = r.y+r.height/2; |
14 | int inset = pointArrowsToArea_inset; |
15 | |
16 | S iLeft = null /* TODO: lost/broken - "#1005637"*/, iDown = "#1005636", iRight = "#1005634", iUp = "#1005635"; |
17 | int rInset = -16; |
18 | |
19 | new L<JWindow> windows; |
20 | BufferedImage img; |
21 | if (iLeft != null) { |
22 | img = loadImage2(iLeft); |
23 | addIfNotNull(windows, freeFloatingAnimation(iLeft, r.x+r.width+inset+rInset, midY-img.getHeight()/2)); |
24 | } |
25 | img = loadImage2(iDown); |
26 | addIfNotNull(windows, freeFloatingAnimation(iDown, midX, r.y-inset-img.getHeight())); |
27 | img = loadImage2(iRight); |
28 | addIfNotNull(windows, freeFloatingAnimation(iRight, r.x-inset-img.getWidth(), midY-img.getHeight()/2)); |
29 | img = loadImage2(iUp); |
30 | addIfNotNull(windows, freeFloatingAnimation(iUp, midX, r.y+r.height+inset)); |
31 | ret disposeWindowsAfter(secondsToMS(seconds), windows); |
32 | } |
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: | 531 / 536 |
Version history: | 2 change(s) |
Referenced in: | [show references] |