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

6
LINES

< > BotCompany Repo | #1005663 // centerScreenPart

JavaX fragment (include)

// factor = 0.75 or something
static Rectangle centerScreenPart(double factor) {
  int x = screenWidth(), y = screenHeight();
  int w = iround(x*factor), h = iround(y*factor);
  ret new Rectangle((x-w)/2, (y-h)/2, w, h);
}

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: #1005663
Snippet name: centerScreenPart
Eternal ID of this version: #1005663/1
Text MD5: 77aae0f79f552c9b4cf9f4e6865b469e
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-02 15:44:30
Source code size: 227 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 493 / 539
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)