# Vector Function
[TOC]
下面兩部分解釋了什么是**向量(vectors)**和**歸一化向量(normalised vectors)**,并且簡要的介紹了如何在你的游戲中使用它們。
## 1. What Is A Vector?
當某些時刻,你創造的游戲非常復雜的時候,你不得不使用向量。它被用于物理學、AI、三角形學(trigonometry)和其他各種情況,但是什么是向量?簡單的說,向量是有指向(方向)的量。我們從**一維向量(1 dimensional vector)**開始看,它是一個帶有數字的箭頭,從數字0指向5。這是向量a,它的大小等于5,并且我們畫另一個向量b,它從5開始到8結束,向量b等于3。

你應該注意到了,向量的開始并不重要,重要的是它的長度和方向。所以向量b從5開始、3個單位長并指向x軸(假設只有x軸)正方向和從0開始、長度為3并指向x+方向的向量是一樣的。向量還可以相加,向量a加向量b結果是長為8的向量c。如果是負數呢?向量看得是方向和大小,而不是位置。

如上是,二維向量。三維向量如下圖,z軸定義是**深度(depth)**

## 2. Normalised Vectors
通常,向量可以在很多情況下使用,但是有時你想要約束它們的值(就像處理角度),這就是為什么我們將它們歸一化。這里使用了一個數學技巧,把向量的長度從n轉化為1,這些轉化過的向量被稱為**單位向量**。

計算單位向量,我們首先得畫出這個向量x、y軸的分量,并且計算出向量的長度(模)。接下來是計算過程。

首先根據坐標求出x、y邊的長度:
```javascript
vx = (x2 - x1) = (7 - 1) = 6
vy = (y2 - y1) = (4 - 1) = 3
```
接著求出向量長:
```javascript
len = sqr(vx2 + vy2) = sqr(36 + 9) = sqr(45) = 6.708203932499369
```
最后,轉化為單位長度:
```javascript
vx = (vx/len) = (6 / 6.708203932499369) = 0.8944271909999159
vy = (vy/len) = (3 / 6.708203932499369) = 0.4472135954999579
a = 1
```
現在我們歸一化了向量,那么我們如何在GMS2中使用它呢?
**例:**假設你在設計一個設計游戲,角色必須射擊敵軍,你需要知道子彈在每一個step沿著x、y軸走多遠才能擊中目標:

為了這個你必須把角色和敵軍的坐標歸一化,并且得到x、y分量轉化的小數值,這些數值將乘以子彈在每一個step中移動的速度,并在最后存儲起來,作為下一步的初始坐標。讓我們看看例子(數值已經四舍五入)
```javascript
px = 100;
py = 425;
ex = 356;
ey = 83;
bullet_speed = 5;
vx = (ex - px) = 256
vy = (ey - py) = -342
len = sqrt(vx2 + vy2) = sqrt(65536 + 116964) = 427.2
vx = vx / len = 0.6
vy = vy / len = 0.8
speed_x = vx * bullet_speed = 3
speed_y = vy * bullet_speed = 4
```
所以,為了達到目標,我們應該在每一步在子彈的x軸加3,y軸加4。
## 3. Function
GMS2也擁有一些基于向量的函數,下面是介紹使用方法
### point_direction
**語法**
`point_direction(x1, y1, x2, y2)`
|參數|描述|
|:----|------ |
|x1 | 向量的第一個分量的x坐標|
|y1 | 向量的第一個分量的y坐標|
|x2 | 向量的第二個分量的x坐標|
|y2 | 向量的第二個分量的y坐標|
**返回類型:** Real
**描述**
這個函數返回由指定的組件[x1,y1]和[x2,y2]形成的向量的方向,與房間的固定x/y坐標有關。如圖,如果我們要讓導彈朝著敵人的方向前進,就可以使用下面例子的代碼。

**舉例**
```javascript
var ex, ey;
ex = instance_nearest(x, y, enemy).x;
ey = instance_nearest(x, y, enemy).y;
with (instance_create_layer(x, y, "Bullets", obj_Missile))
{
direction = point_direction(x, y, ex, ey);
}
```
**理解**
多次試驗之后我發現這個函數返回的結果是度數,設向量與x軸正半軸的夾角為α。
例如:
1. 初始坐標[0, 0] ----》 [1, 1] 得到結果315
2. 初始坐標[0, 0] ----》 [1, 0] 得到結果270
3. 初始坐標[0, 0] ----》 [0,-1] 得到結果90
4. 初始坐標[0, 0] ----》 [-1,0] 得到結果180
5. 初始坐標[0, 0] ----》 [1,-1] 得到結果45

如果把這些結果做成圖形我們會清晰的發現,返回的度數是`360-α`
------------
### point_distance
**語法**
`point_distance(x1, y1, x2, y2);`
|參數|描述|
|:----|------ |
|x1 | 向量的第一個分量的x坐標|
|y1 | 向量的第一個分量的y坐標|
|x2 | 向量的第二個分量的x坐標|
|y2 | 向量的第二個分量的y坐標|
**返回類型:**Real
**描述**
返回向量的長度

**舉例**
```javascript
var ex, ey;
ex = instance_nearest(x, y, enemy).x;
ey = instance_nearest(x, y, enemy).y;
if point_distance(x, y, ex, ey) < 200
{
instance_create_layer(x, y, "Bullets", obj_Missile)
}
```
上面代碼自動檢測最近的敵軍的位置,如果角色與敵軍的距離小于200,就會自動生成導彈。
------------
### point_distance_3d
**語法**
`point_distance_3d(x1, y1, z1, x2, y2, z2);`
|參數|描述|
|:----|------ |
|x1 | 向量的第一個分量的x坐標|
|y1 | 向量的第一個分量的y坐標|
|z1 | 向量的第一個分量的z坐標|
|x2 | 向量的第二個分量的x坐標|
|y2 | 向量的第二個分量的y坐標|
|z2 | 向量的第二個分量的z坐標|
**返回類型:**Real
**描述**
這個方法使用方式和point_distance一樣。加上了z軸用于3D空間。
**舉例**
```javascript
var inst, ex, ey, ez;
inst = instance_nearest(x, y, enemy);
if inst
{
ex = inst.x;
ey = inst.y;
ez = inst.z;
if point_distance_3d(x, y, z, ex, ey, ez) < 200
{
instance_create_layer(x, y, "Bullets", obj_Missile)
}
}
```
上面代碼自動檢測最近的敵軍的位置,如果角色與敵軍的距離小于200,就會自動生成導彈。
------------
### distance_to_object
**語法**
`distance_to_object( obj );`
|參數|描述|
|:----|------ |
|obj |要檢查的對象 |
**返回類型:**Real
**描述**
這個函數計算兩個實例包圍盒(邊框)間的距離:你在哪個obj使用這個函數---》輸入的obj間的距離。輸入的obj的內容可以是它的索引或者ID,也可以是關鍵字**other**,并且返回的距離以像素為單位。請注意,如果兩個obj的任意一個都沒有使用精靈(sprite)或者遮罩(mask),那么返回結果是不正確的。
**舉例**
```javascript
if distance_to_object(obj_Player) < range
{
canshoot = true;
}
```
上面的代碼檢查到player對象的距離,如果它小于在變量“range”中存儲的值,那么變量“canshoot”將被設置為true。
------------
### distance_to_point
**語法**
`distance_to_point(x, y);`
|參數|描述|
|:----|------ |
|x |要檢查位置的x坐標 |
|y |要檢查位置的y坐標 |
**返回類型:**Real
**描述**
這個函數計算調用實例的包圍盒到指定x、y坐標的距離,返回值為像素。請注意,如果調用實例沒有使用精靈(sprite)或者遮罩(mask),那么返回結果是不正確的。
**舉例**
```javascript
if distance_to_point(obj_Player.x, obj_Player.y) < range
{
canshoot = true;
}
```
上面的代碼檢查到player對象當前坐標的距離,如果它小于在變量“range”中存儲的值,那么變量“canshoot”將被設置為true。
------------
### dot_product
**語法**
`dot_product(x1, y1, x2, y2)`
|參數|描述|
|:----|------ |
|x1 | 向量的第一個分量的x坐標|
|y1 | 向量的第一個分量的y坐標|
|x2 | 向量的第二個分量的x坐標|
|y2 | 向量的第二個分量的y坐標|
**返回類型:**Real
**描述**
點積(dot product)是表示兩個向量間角度的關系的值,通過取兩個向量,將他們相乘然后相加。"點積"這個名字由來是從中心點"·",它經常被用來指代這個運算(替代名稱“標量積”強調結果的標量而不是向量性質)
實際的數學公式可以寫成這樣:

因此,在2D中,向量a[x1,y1]和b[x2,y2]的點積結果是x1x2+y1y2,在GMS2中計算
```javascript
a · b = (x1*x2)+(y1*y2);
```
點積的奇怪之處在于它的輸入向量與向量形成的角度間的關系,可以表示為:
```javascript
a · b = (length of a) * (length of b) * cos(angle)
```
即,點積等于兩個向量的模乘以向量夾角的余弦,如下圖

我們可以從向量點積的結果得出如下結論
- 向量a與向量b垂直,點積為0,因為cos90為0
- 向量a與向量b間的夾角小于90度,點積將是正的(大于零),因為cos(ang)是正的。
- 向量a與向量b間的夾角大于90度,點積將為負(小于零),因為cos(ang)將為負。
所以我們如何將其運用到游戲中呢?這種數學關系能夠運用到相當多種情況,但最好的方式是你自己建立一個實際的場景,看看會發生什么。簡單的例子,角色位于敵人正前方90度之內就會被發現。

基本上,我們要得到敵人的法線(包括方向和視線距離),之后我們需要得到角色和敵人間的向量。并且得到這些向量的點積,若結果為正,角色會被看到,負則不會。實際的代碼如下
**舉例**
```javascript
var x1, y1, x2, y2;
x1 = lengthdir_x(1, image_angle);
y1 = lengthdir_y(1, image_angle);
x2 = o_Player.x - x;
y2 = o_Player.y - y;
if dot_product(x1, y1, x2, y2) > 0 seen=true else seen=false;
```
上面的代碼在敵人中用實例圖像的角度創建向量,接著得到角色和自己本身的距離。最后,計算出這兩個向量的點積,如果大于可以被看見,否則不行。
------------
### dot_product_3d
**語法**
`dot_product_3d(x1, y1, z1, x2, y2, z2)`
|參數|描述|
|:----|------ |
|x1 | 向量的第一個分量的x坐標|
|y1 | 向量的第一個分量的y坐標|
|z1 | 向量的第一個分量的z坐標|
|x2 | 向量的第二個分量的x坐標|
|y2 | 向量的第二個分量的y坐標|
|z2 | 向量的第二個分量的z坐標|
**返回類型:**Real
**描述**
點積(dot product)是表示兩個向量間角度的關系的值,通過取兩個向量,將他們相乘然后相加。"點積"這個名字由來是從中心點"·",它經常被用來指代這個運算(替代名稱“標量積”強調結果的標量而不是向量性質)
實際的數學公式可以寫成這樣:

因此,在2D中,向量a[x1,y1]和b[x2,y2]的點積結果是x1x2+y1y2,在GMS2中計算
```javascript
a · b = (x1*x2)+(y1*y2);
```
點積的奇怪之處在于它的輸入向量與向量形成的角度間的關系,可以表示為:
```javascript
a · b = (length of a) * (length of b) * cos(angle)
```
即,點積等于兩個向量的模乘以向量夾角的余弦,如下圖

我們可以從向量點積的結果得出如下結論
- 向量a與向量b垂直,點積為0,因為cos90為0
- 向量a與向量b間的夾角小于90度,點積將是正的(大于零),因為cos(ang)是正的。
- 向量a與向量b間的夾角大于90度,點積將為負(小于零),因為cos(ang)將為負。
所以這對我們做游戲的人來說意味著什么呢?這個數學關系式能在許多種情況下運用,但是最好的方法是你親自建立一個模擬的場景,并且看看會發生什么。最簡單的方法是為視野內的敵人生成一個簡單的“高度”檢測,敵人將會看到角色,如果敵人建立在法線和3d平面上。

基本上,我們根據敵人和地板的角度得到法向量,并且還得到角色到敵人的向量。我們接著可以得到這些向量的點積。根據前面的推論,如果結果為正(夾角小于90°),角色在敵人平面之上;如果為負,則在其之下。實際代碼示例如下:
**舉例**
```javascript
//在enemy中
var x1, y1, x2, y2;
x1 = 0;
y1 = 1;
z1 = 0;
x2 = o_Player.x - x;
y2 = o_Player.y - y;
z2 = o_Player.z - z;
if dot_product_3d(x1, y1, z1, x2, y2, z2) > 0 above=true else above=false;
```
上面的代碼沿著實例y(上半)軸創建了一個向量1(法向量),接著根據o_Player到自身又創建了向量2。最后計算這兩個向量的點積,并判斷是否大于0。
------------
### dot_product_normalised
**語法**
`dot_product_normalised(x1, y1, x2, y2)`
|參數|描述|
|:----|------ |
|x1 | 向量的第一個分量的x坐標|
|y1 | 向量的第一個分量的y坐標|
|x2 | 向量的第二個分量的x坐標|
|y2 | 向量的第二個分量的y坐標|
**返回類型:**Real
**描述**
點積(dot product)是表示兩個向量間角度的關系的值,通過取兩個向量,將他們相乘然后相加。"點積"這個名字由來是從中心點"·",它經常被用來指代這個運算(替代名稱“標量積”強調結果的標量而不是向量性質)
實際的數學公式可以寫成這樣:

因此,在2D中,向量a[x1,y1]和b[x2,y2]的點積結果是x1x2+y1y2,在GMS2中計算
```javascript
a · b = (x1*x2)+(y1*y2);
```
那么標準化點積呢?標準化點積得到修正,返回值在-1~1間(詳情見Normalised Vectors),在很多情況下是非常有用的,特別是在處理照明和其他3D功能時。
**舉例**
```javascript
var x1, y1, x2, y2;
x1 = lengthdir_x(1, image_angle);
y1 = lengthdir_y(1, image_angle);
x2 = o_Player.x - x;
y2 = o_Player.y - y;
if dot_product_normalised(x1, y1, x2, y2) > 0 seen=true else seen=false;
```
上面的代碼在敵人中用實例圖像的角度創建向量,接著得到角色和自己本身的距離。最后,計算出這兩個向量的點積,如果大于可以被看見,否則不行。
------------
### dot_product_3d_normalised
**語法**
`dot_product_3d(x1, y1, z1, x2, y2, z2)`
|參數|描述|
|:----|------ |
|x1 | 向量的第一個分量的x坐標|
|y1 | 向量的第一個分量的y坐標|
|z1 | 向量的第一個分量的z坐標|
|x2 | 向量的第二個分量的x坐標|
|y2 | 向量的第二個分量的y坐標|
|z2 | 向量的第二個分量的z坐標|
**返回類型:**Real
**描述**
點積(dot product)是表示兩個向量間角度的關系的值,通過取兩個向量,將他們相乘然后相加。"點積"這個名字由來是從中心點"·",它經常被用來指代這個運算(替代名稱“標量積”強調結果的標量而不是向量性質)
實際的數學公式可以寫成這樣:

因此,在2D中,向量a[x1,y1]和b[x2,y2]的點積結果是x1x2+y1y2,在GMS2中計算
```javascript
a · b = (x1*x2)+(y1*y2);
```
那么標準化點積呢?標準化點積得到修正,返回值在-1~1間(詳情見Normalised Vectors),在很多情況下是非常有用的,特別是在處理照明和其他3D功能時。
**舉例**
```javascript
var x1, y1, x2, y2;
x1 = 0;
y1 = 1;
z1 = 0;
x2 = o_Player.x - x;
y2 = o_Player.y - y;
z2 = o_Player.z - z;
if dot_product_3d_normalised(x1, y1, z1, x2, y2, z2) > 0 above=true else above=false;
```
上面的代碼沿著實例y(上半)軸創建了一個向量1(法向量),接著根據o_Player到自身又創建了向量2。最后計算這兩個向量的點積,并判斷是否大于0。
------------
### angle_difference
**語法**
`angle_difference(ang1, ang2)`
|參數|描述|
|:----|------ |
|ang1 | 第一個角度|
|y1 | 第二個角度|
**返回類型:**Real
**描述**
這個函數將返回兩個角度之間最小的角度差值,在-180度和180度之間(正角是逆時針,負角是順時針)。
**舉例**
```javascript
var pd = point_direction(x, y, mouse_x, mouse_y);
var dd = angle_difference(image_angle, pd);
image_angle -= min(abs(dd), 10) * sign(dd);
```
pd為當前位置到鼠標位置與x(正半)軸間的角度,dd為當前image_angle與pd的差別度數。功能為可以讓圖片緩慢朝著鼠標位置旋轉。
- 介紹
- 新手須知
- 版本授權
- 安裝
- 更新
- 發布日志
- 所需SDK
- 賬號
- 首選項設置
- 拖拽編程
- 擴展編輯器設置
- 基本項設置
- 圖片編輯器設置
- 語言設置
- 市場設置
- 對象編輯器設置
- 插件設置
- 資源樹設置
- 場景編輯器設置
- 運行庫設置
- 樣條編輯器設置
- 精靈編輯器設置
- 文本編輯器設置
- 瓷片編輯器設置
- 時間軸設置
- 輸入
- 快速上手
- 概覽
- 啟動頁
- 工作區
- 資源樹
- 工作流
- 創建精靈
- 創建瓷片集
- 創建音頻
- 創建對象
- 創建場景
- 編譯
- 調試
- 快捷鍵
- 菜單
- 文件菜單
- 編輯菜單
- 構建菜單
- 窗口菜單
- 工具菜單
- 市場菜單
- 幫助菜單
- 布局菜單
- 附加信息
- 位運算符和二進制
- 命令行
- 出錯信息
- 文件系統
- 導入非位圖精靈
- JSDoc使用
- 微型WEB服務端
- 過時函數
- 紋理頁
- 使用緩沖區
- 編輯器
- 擴展編輯器
- 字體編輯器
- 圖像編輯器
- 內含文件編輯器
- 備注編輯器
- 對象編輯器
- 路徑編輯器
- 場景編輯器
- 腳本編輯器
- 著色器編輯器
- 音頻編輯器
- 精靈編輯器
- 瓷片集編輯器
- 時間軸編輯器
- 對象可用事件
- 異步事件
- 繪制事件
- 手勢事件
- 其它
- 調試管理器
- 設備管理器
- YoYo資源市場
- 輸出停靠欄
- 項目圖生成器
- 最近使用窗口
- 遠程工作
- 混音器
- 版本控制
- 設置項
- 音頻組
- 配置項
- 跨平臺配置
- 紋理組
- 游戲配置選項
- AmazonFire 配置
- Android配置
- HTML5配置
- iOS配置
- Linux配置
- Mac配置
- Windows配置
- WindowsUWP配置
- 腳本編程
- 拖放編程概覽
- 拖放編程功能索引
- GML概覽
- 代碼
- 數組
- array_create
- array_copy
- array_equals
- array_length_1d
- array_height_2d
- array_length_2d
- 賦值
- 表達式
- 數據存取
- 功能性語法
- 函數
- 腳本
- 注釋
- 關鍵詞
- 變量及作用域
- variable_global_exists
- variable_global_get
- variable_global_set
- variable_instance_exists
- variable_instance_get
- variable_instance_get_names
- variable_instance_set
- 尋址變量
- 評估順序
- 數據類型
- is_array
- is_bool
- is_int32
- is_int64
- is_matrix
- is_ptr
- is_real
- is_string
- is_undefined
- is_vec3
- is_vec4
- 變元計數
- 指針
- 內置變量屬性
- async_load
- health
- lives
- score
- GML函數索引
- asset_get_index
- asset_get_type
- Compatibility_Functions
- Asynchronous Functions
- Audio
- Buffers
- Cameras And Display (攝像機和顯示)
- Cameras(攝像機)
- camera_apply
- camera_create
- camera_create_view
- camera_destroy
- camera_get_active
- camera_get_begin_script
- camera_get_default
- camera_get_end_script
- camera_get_proj_mat
- camera_get_update_script
- camera_get_view_angle
- camera_get_view_border_x
- camera_get_view_border_y
- camera_get_view_height
- camera_get_view_mat
- camera_get_view_speed_x
- camera_get_view_speed_y
- camera_get_view_target
- camera_get_view_width
- camera_get_view_x
- camera_get_view_y
- camera_set_begin_script
- camera_set_default
- camera_set_end_script
- camera_set_proj_mat
- camera_set_update_script
- camera_set_view_angle
- camera_set_view_border
- camera_set_view_mat
- camera_set_view_pos
- camera_set_view_size
- camera_set_view_speed
- camera_set_view_target
- view_camera
- view_current
- view_enabled
- view_get_camera
- view_get_hport
- view_get_surface_id
- view_get_visible
- view_get_wport
- view_get_xport
- view_get_yport
- view_hport
- view_set_camera
- view_set_hport
- view_set_surface_id
- view_set_visible
- view_set_wport
- view_set_xport
- view_set_yport
- view_surface_id
- view_visible
- view_wport
- view_xport
- view_yport
- The Screen Display
- Controls
- Data_Structures(數據結構)
- ds_exists
- ds_set_precision
- DS Grids
- DS Lists(列表)
- ds_list_create
- ds_list_destroy
- ds_list_clear
- ds_list_empty
- ds_list_size
- ds_list_add
- ds_list_set
- ds_list_delete
- ds_list_find_index
- ds_list_find_value
- ds_list_insert
- ds_list_replace
- ds_list_shuffle
- ds_list_sort
- ds_list_copy
- ds_list_read
- ds_list_write
- ds_list_mark_as_list
- ds_list_mark_as_map
- DS Maps(映射表)
- ds_map_exists
- ds_map_create
- ds_map_add
- ds_map_clear
- ds_map_copy
- ds_map_replace
- ds_map_delete
- ds_map_empty
- ds_map_size
- ds_map_find_first
- ds_map_find_last
- ds_map_find_next
- ds_map_find_previous
- ds_map_find_value
- ds_map_read
- ds_map_write
- ds_map_destroy
- ds_map_secure_save
- ds_map_secure_save_buffer
- ds_map_secure_load
- ds_map_secure_load_buffer
- ds_map_add_list
- ds_map_add_map
- ds_map_replace_list
- ds_map_replace_map
- DS Priority Queues
- DS Queues
- DS Stacks
- Debugging
- Drawing
- draw_enable_drawevent
- draw_flush
- Colour(顏色)
- colour_get_blue
- colour_get_green
- colour_get_hue
- colour_get_red
- colour_get_saturation
- colour_get_value
- draw_clear
- draw_clear_alpha
- draw_get_alpha
- draw_get_colour
- draw_getpixel
- draw_getpixel_ext
- draw_set_alpha
- draw_set_colour
- make_colour_hsv
- make_colour_rgb
- merge_colour
- Forms
- draw_arrow
- draw_button
- draw_circle
- draw_circle_colour
- draw_ellipse
- draw_ellipse_colour
- draw_healthbar
- draw_line
- draw_line_colour
- draw_line_width
- draw_line_width_colour
- draw_path
- draw_point
- draw_point_colour
- draw_rectangle
- draw_rectangle_colour
- draw_roundrect
- draw_roundrect_colour
- draw_roundrect_colour_ext
- draw_roundrect_ext
- draw_set_circle_precision
- draw_triangle
- draw_triangle_colour
- GPU
- gpu_get_alphatestenable
- gpu_get_alphatestref
- gpu_get_blendenable
- gpu_get_blendmode
- gpu_get_blendmode_dest
- gpu_get_blendmode_destalpha
- gpu_get_blendmode_ext
- gpu_get_blendmode_ext_sepalpha
- gpu_get_blendmode_src
- gpu_get_blendmode_srcalpha
- gpu_get_colorwriteenable
- gpu_get_cullmode
- gpu_get_fog
- gpu_get_state
- gpu_get_texfilter
- gpu_get_texfilter_ext
- gpu_get_texrepeat
- gpu_get_texrepeat_ext
- gpu_get_zfunc
- gpu_get_ztestenable
- gpu_get_zwriteenable
- gpu_pop_state
- gpu_push_state
- gpu_set_alphatestenable
- gpu_set_alphatestref
- gpu_set_blendenable
- gpu_set_blendmode
- gpu_set_blendmode_ext
- gpu_set_blendmode_ext_sepalpha
- gpu_set_colorwriteenable
- gpu_set_cullmode
- gpu_set_fog
- gpu_set_state
- gpu_set_texfilter
- gpu_set_texfilter_ext
- gpu_set_texrepeat
- gpu_set_texrepeat_ext
- gpu_set_zfunc
- gpu_set_ztestenable
- gpu_set_zwriteenable
- Lighting
- draw_get_lighting
- draw_light_define_ambient
- draw_light_define_direction
- draw_light_define_point
- draw_light_enable
- draw_light_get
- draw_light_get_ambient
- draw_set_lighting
- Mipmapping
- gpu_get_tex_max_aniso
- gpu_get_tex_max_aniso_ext
- gpu_get_tex_max_mip
- gpu_get_tex_max_mip_ext
- gpu_get_tex_min_mip
- gpu_get_tex_min_mip_ext
- gpu_get_tex_mip_bias
- gpu_get_tex_mip_bias_ext
- gpu_get_tex_mip_enable
- gpu_get_tex_mip_enable_ext
- gpu_get_tex_mip_filter
- gpu_get_tex_mip_filter_ext
- gpu_set_tex_max_aniso
- gpu_set_tex_max_aniso_ext
- gpu_set_tex_max_mip
- gpu_set_tex_max_mip_ext
- gpu_set_tex_min_mip
- gpu_set_tex_min_mip_ext
- gpu_set_tex_mip_bias
- gpu_set_tex_mip_bias_ext
- gpu_set_tex_mip_enable
- gpu_set_tex_mip_enable_ext
- gpu_set_tex_mip_filter
- gpu_set_tex_mip_filter_ext
- Particles
- Particle Emitters
- part_emitter_burst
- part_emitter_clear
- part_emitter_create
- part_emitter_destroy
- part_emitter_destroy_all
- part_emitter_exists
- part_emitter_region
- part_emitter_stream
- Particle Systems
- part_particles_clear
- part_particles_count
- part_particles_create
- part_particles_create_colour
- part_system_automatic_draw
- part_system_automatic_update
- part_system_clear
- part_system_create
- part_system_create_layer
- part_system_depth
- part_system_destroy
- part_system_draw_order
- part_system_drawit
- part_system_exists
- part_system_get_layer
- part_system_layer
- part_system_position
- part_system_update
- Particle Types
- part_type_alpha1
- part_type_alpha2
- part_type_alpha3
- part_type_blend
- part_type_clear
- part_type_colour_hsv
- part_type_colour_mix
- part_type_colour_rgb
- part_type_colour1
- part_type_colour2
- part_type_colour3
- part_type_create
- part_type_death
- part_type_destroy
- part_type_direction
- part_type_exists
- part_type_gravity
- part_type_life
- part_type_orientation
- part_type_scale
- part_type_shape
- part_type_size
- part_type_speed
- part_type_sprite
- part_type_step
- Simple Effects
- ef_cloud
- ef_ellipse
- ef_explosion
- ef_firework
- ef_flare
- ef_rain
- ef_ring
- ef_smoke
- ef_smokeup
- ef_snow
- ef_spark
- ef_star
- effect_clear
- effect_create_above
- effect_create_below
- Primitives(基本幾何體)
- draw_primitve_begin
- draw_primitive_begin_texture
- draw_primitive_end
- draw_vertex
- draw_vertex_colour
- draw_vertex_texture
- draw_vertex_texture_colour
- Primitive Building
- vertex_argb
- vertex_begin
- vertex_colour
- vertex_create_buffer
- vertex_create_buffer_ext
- vertex_create_buffer_from_buffer
- vertex_create_buffer_from_buffer_ext
- vertex_delete_buffer
- vertex_end
- vertex_float1
- vertex_float2
- vertex_float3
- vertex_float4
- vertex_freeze
- vertex_get_buffer_size
- vertex_get_number
- vertex_normal
- vertex_position
- vertex_position_3d
- vertex_submit
- vertex_texcoord
- vertex_ubyte4
- Vertex Formats
- vertex_format_add_colour
- vertex_format_add_custom
- vertex_format_add_normal
- vertex_format_add_position
- vertex_format_add_position_3d
- vertex_format_add_textcoord
- vertex_format_begin
- vertex_format_delete
- vertex_format_end
- Sprites_and_Tiles
- draw_enable_swf_aa
- draw_get_swf_aa_level
- draw_self
- draw_set_swf_aa_level
- draw_skeleton
- draw_skeleton_collision
- draw_skeleton_instance
- draw_skeleton_time
- draw_sprite
- draw_sprite_ext
- draw_sprite_general
- draw_sprite_part
- draw_sprite_part_ext
- draw_sprite_pos
- draw_sprite_stretched
- draw_sprite_stretched_ext
- draw_sprite_tiled
- draw_sprite_tiled_ext
- draw_tile
- draw_tilemap
- Surfaces
- application_get_position
- application_surface
- application_surface_draw_enable
- application_surface_enable
- application_surface_is_enabled
- draw_surface
- draw_surface_ext
- draw_surface_general
- draw_surface_part
- draw_surface_part_ext
- draw_surface_stretched
- draw_surface_stretched_ext
- draw_surface_tiled
- draw_surface_tiled_ext
- surface_copy
- surface_copy_part
- surface_create
- surface_create_ext
- surface_exists
- surface_free
- surface_get_height
- surface_get_texture
- surface_get_width
- surface_getpixel
- surface_getpixel_ext
- surface_reset_target
- surface_resize
- surface_save
- surface_save_part
- surface_set_target
- surface_set_target_ext
- The Application Surface
- Text
- draw_highscore
- draw_set_font
- draw_set_halign
- draw_set_valign
- draw_text
- draw_text_colour
- draw_text_ext
- draw_text_ext_colour
- draw_text_ext_transformed
- draw_text_ext_transformed_colour
- draw_text_transformed
- draw_text_transformed_colour
- Textures
- draw_texture_flush
- texture_get_height
- texture_get_texel_height
- texture_get_texel_width
- texture_get_uvs
- texture_get_width
- texture_global_scale
- texture_set_stage
- File Handing
- Fonts
- Game
- In App Purchases
- Instances
- 數學運算(Maths)
- Date and Time
- 數字方法(Number Functions)
- Vector Functions
- Matrices
- Miscellaneous
- Movement and Collisions
- Networking
- Objects
- Paths
- Physics
- 場景(Rooms)
- 常規的場景函數及變量(General Room Functions And Varibales)
- 常規圖層函數(General Layer Functions)
- 瓷片函數(TIlemap Tile Functions)
- 背景圖層(Backgrounds)
- 精靈圖層(Sprites)
- Scirpts
- Shaders
- Sprites
- Steam API
- Strings
- Timelines
- Web
- XBox_Live
- 翻譯名詞對照表