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

16
LINES

< > BotCompany Repo | #1006974 // Follow the mouse cursor with a heart

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (3527L/23K/80K).

1  
!7
2  
3  
sS imageID = #1006973;
4  
static int width = 200;
5  
6  
p {
7  
  BufferedImage img = loadBufferedImage(imageID);
8  
  BufferedImage resized = resizeImage(img, width);
9  
  final Window w = showAnimation(resized);
10  
  final Shape shape = scaleShape(alphaToShape(img), width/(double) img.getWidth());
11  
  swing { w.setShape(shape); }
12  
  
13  
  repeat with ms sleep 20 {
14  
    w.setLocation(mouseX()+2, mouseY()+2);
15  
  }
16  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006974
Snippet name: Follow the mouse cursor with a heart
Eternal ID of this version: #1006974/13
Text MD5: 0b158232d18206d408ef416c058b2f7c
Transpilation MD5: 76dbf0fa98d2d0257931a8eb1470f1aa
Author: stefan
Category: javax / gui effects
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-02-21 20:40:56
Source code size: 409 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 471 / 598
Version history: 12 change(s)
Referenced in: [show references]