Skip to content

Commit

Permalink
update docs. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Aug 2, 2024
1 parent 4a22ca3 commit b840407
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 80 deletions.
25 changes: 25 additions & 0 deletions Docs/docs/api/Class Object/Sprite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,31 @@ local Sprite = require("Sprite")
local sprite = Sprite("Image/file.png")
```

## getClips

**Type:** Function.

**Description:**

  Gets the clip names and rectangles from the clip file.

**Signature:**
```tl
getClips: function(self: SpriteClass, clipFile: string): {string, Rect} | nil
```

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| clipFile | string | The clip file name to load, should end with ".clip". |

**Returns:**

| Return Type | Description |
| --- | --- |
| \{string, Rect} \| nil | A table containing the clip names and rectangles. |

## __call

**Type:** Metamethod.
Expand Down
53 changes: 14 additions & 39 deletions Docs/docs/api/Class/Buffer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ import "@site/src/languages/highlight";
const size: integer
```

## text

**Type:** Field.

**Description:**

  Getting or setting the text stored in the buffer.

**Signature:**
```tl
text: string
```

## resize

**Type:** Function.
Expand Down Expand Up @@ -53,42 +66,4 @@ resize: function(self: Buffer, size: integer)
**Signature:**
```tl
zeroMemory: function(self: Buffer)
```

## toString

**Type:** Function.

**Description:**

  Converting the buffer to a string.

**Signature:**
```tl
toString: function(self: Buffer): string
```

**Returns:**

| Return Type | Description |
| --- | --- |
| string | The buffer contents as a string. |

## setString

**Type:** Function.

**Description:**

  Setting the contents of the buffer with a string.

**Signature:**
```tl
setString: function(self: Buffer, str: string)
```

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| str | string | The new contents of the buffer. |
```
2 changes: 1 addition & 1 deletion Docs/docs/api/Module/threadLoop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ threadLoop: function(routine: function(): boolean): Routine.Job

| Parameter | Type | Description |
| --- | --- | --- |
| routine | function | A function to execute repeatedly as a coroutine. |
| routine | function | A function to execute repeatedly as a coroutine. The function should return false to continue running, or true to stop. |

**Returns:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,31 @@ local Sprite = require("Sprite")
local sprite = Sprite("Image/file.png")
```

## getClips

**类型:** 函数。

**描述:**

  从图集切片文件中获取切片名称和矩形区域。

**签名:**
```tl
getClips: function(self: SpriteClass, clipFile: string): {string, Rect} | nil
```

**参数:**

| 参数名 | 类型 | 描述 |
| --- | --- | --- |
| clipFile | string | 要加载的图集切片文件,文件后缀名必须是".clip"。 |

**返回值:**

| 返回类型 | 描述 |
| --- | --- |
| \{string, Rect} \| nil | 包含切片名称和矩形区域的表。 |

## __call

**类型:** 元方法。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ import "@site/src/languages/highlight";
const size: integer
```

## text

**类型:** 成员变量。

**描述:**

  设置或获取缓冲区存储的文本。

**签名:**
```tl
text: string
```

## resize

**类型:** 函数。
Expand Down Expand Up @@ -53,42 +66,4 @@ resize: function(self: Buffer, size: integer)
**签名:**
```tl
zeroMemory: function(self: Buffer)
```

## toString

**类型:** 函数。

**描述:**

  将缓冲区转换为字符串。

**签名:**
```tl
toString: function(self: Buffer): string
```

**返回值:**

| 返回类型 | 描述 |
| --- | --- |
| string | 缓冲区内容的字符串表示形式。 |

## setString

**类型:** 函数。

**描述:**

  使用字符串设置缓冲区的内容。

**签名:**
```tl
setString: function(self: Buffer, str: string)
```

**参数:**

| 参数名 | 类型 | 描述 |
| --- | --- | --- |
| str | string | 缓冲区的新内容。 |
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ threadLoop: function(routine: function(): boolean): Routine.Job

| 参数名 | 类型 | 描述 |
| --- | --- | --- |
| routine | function | 要进行重复执行的函数。 |
| routine | function | 要进行重复执行的函数。函数可以返回 false 以继续运行,或返回 true 以停止。 |

**返回值:**

Expand Down

0 comments on commit b840407

Please sign in to comment.