10000 Screen documentation · SRWieZ/fork-nativephp.com@718143a · GitHub
[go: up one dir, main page]

Skip to content

Commit 718143a

Browse files
committed
Screen documentation
1 parent 18eeac9 commit 718143a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Screens
3+
order: 850
4+
---
5+
# Screens
6+
7+
The `Screen` facade lets you get information about the screens currently connected to the computer.
8+
9+
```php
10+
use Native\Laravel\Facades\Screen;
11+
```
12+
13+
## Displays
14+
15+
The `displays` method gives you an array of information about all the displays actually used.
16+
17+
If you use an external display with your laptop screen closed, the internal screen of your laptop will not be part of the array.
18+
19+
See [Display object](https://www.electronjs.org/docs/latest/api/structures/display) documentation.
20+
21+
```php
22+
$screens = Screen::displays();
23+
```
24+
25+
## Cursor position
26+
27+
The `cursorPosition` method gives you the coordinates of the current absolute position of the mouse cursor.
28+
29+
```php
30+
$position = Screen::cursorPosition();
31+
32+
$position->x
33+
$position->y
34+
```

0 commit comments

Comments
 (0)
0