fix DrawText func && add enum with text encoding && update manual && other

This commit is contained in:
2025-04-07 21:11:37 +05:00
parent d6b784814f
commit 593c4a6596
7 changed files with 127 additions and 36 deletions

View File

@@ -12,18 +12,70 @@ local syscalls = require("syscalls")
syscalls.Event.<EventName>
```
+ `Redraw`
+ `Button`
+ `Key`
+ `Desktop`
+ `Mouse`
+ `Network`
+ `IPC`
+ `Debug`
## Graphic
### Text encoding
+ `cp866`
+ `utf8`
+ `utf16`
### Text sizes
```lua
syscalls.textSize.<value>
```
+ `6x9` (cp866 only)
+ `8x16`
+ `12x18` (cp866 only)
+ `16x32`
+ `18x27` (cp866 only)
+ `24x36` (cp866 only)
+ `24x48`
+ `30x45` (cp866 only)
+ `32x64`
+ `36x54` (cp866 only)
+ `40x80`
+ `42x63` (cp866 only)
+ `48x72` (cp866 only)
+ `48x96`
+ `56x112`
+ `64x128`
### `DrawText(text, xPos, yPos, textColor, textSize, textLen, backgroundColor, encoding)`
Draw text.
textSize, textLen, backgroundColor, encoding are optional.
### `DrawLine(x1, y1, x2, y2)`
### `DrawRectangle(x, y, w, h color)`
### `ReadPoint(x, y)`
return color
## Sockets
### OpenSocket
### `OpenSocket(domain, type, protocol)`
```lua
local socket, err = syscalls.OpenSocket()
local socket, err = syscalls.OpenSocket(
syscalls.SOCK.STREAM,
syscalls.AF.INET,
syscalls.IPPROTO.IP
)
if err then
print("Error", err)
@@ -32,9 +84,9 @@ else
end
```
### CloseSocket(socket)
### `CloseSocket(socket)`
### PairSocket()
### `PairSocket()`
```lua
local first, second = PairSocket()
@@ -46,19 +98,19 @@ else
end
```
### Bind(socket, address)
### `Bind(socket, address)`
### Listen(socket, backlog)
### `Listen(socket, backlog)`
### Connect()
### `Connect(socket, address)`
### Accept
### `Accept(socket, , flags)`
### Receive
### `Receive(socket, , flags)`
## SetSocketOption
### `SetSocketOption(socket, opt)`
### GetSocketOption
### `GetSocketOption(socket, opt)`
### Socket types