|
Post by honkytonk on Aug 18, 2020 22:44:24 GMT
Hello, can someone tell me if we can know the dimensions of the screen (pixels) of the host machine and if so how? Thank you
|
|
|
Post by B+ on Aug 18, 2020 23:36:36 GMT
WindowWidth = XMAX + 8 WindowHeight = YMAX + 32 UpperLeftX = (DisplayWidth - XMAX) / 2 UpperLeftY = (DisplayHeight - YMAX) / 2
DisplayWidth X DisplayHeight is what is available on your machine.
The above code displays your XMAX + 8 by YMAX + 32 (no menu bar) JB Window centered in your machines screen.
XMAX by YMAX are the actual pixels you can draw with. The 8 and the 32 are for borders + y has title bar.
I start my programs specifying what I want in pixel width and height, XMAX and YMAX make CONSTANTS = GLOBAL variables in JB.
Then I add 8 to XMAX and 32 to YMAX to specify my JB Window Width and Height (again assuming no Menu bar).
Sorry I forget how high the menu bar is 20-22? (add that to Y height if you use one)
|
|
|
Post by honkytonk on Aug 19, 2020 8:01:52 GMT
Ah yes, how stupid I am !! I don't really like the: "UpperLeftX = (DisplayWidth - XMAX) / 2" because I noticed that there could be disputes when we open one more window (tangling of brushes during placement); and suddenly, I forgot the saviour: "DisplayWidth" Thank you so much.
|
|