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

17
LINES

< > BotCompany Repo | #1015025 // Renderable

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5636L/31K).

sinterface Renderable extends MakesBufferedImage, G2Drawable {
  void renderOn(Graphics2D g, int w, int h);
  
  default Pt preferredSize() { ret pt(640, 480); }
  
  default int getWidth() { ret preferredSize().x; }
  default int getHeight() { ret preferredSize().y; }
  
  default BufferedImage getBufferedImage aka render() {
    ret renderableToImage(this);
  }
  
  // unknown size
  default void drawOn(Graphics2D g) {
    renderOn(g, -1, -1);
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1015025
Snippet name: Renderable
Eternal ID of this version: #1015025/8
Text MD5: 911d376be64e2b315c92fba438f0a5f3
Transpilation MD5: 5019e922b0fe61a3577b048b0bf1f8a8
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-15 17:58:51
Source code size: 471 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 431 / 1090
Version history: 7 change(s)
Referenced in: [show references]