/
Viewport.json
170 lines (170 loc) · 3.43 KB
/
Viewport.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
{
"name": "Viewport",
"description": "Work with screen properties and effects.",
"authority": "client",
"static_functions": [
{
"name": "ProjectWorldToScreen",
"description": "Transforms a 3D world-space vector into 2D screen coordinates",
"authority": "client",
"parameters": [
{
"type": "Vector",
"name": "world_position",
"description": "World 3D position"
}
],
"return": [
{
"type": "Vector2D"
}
]
},
{
"name": "DeprojectScreenToWorld",
"description": "Transforms a 2D screen coordinates into 3D world-space location",
"authority": "client",
"parameters": [
{
"type": "Vector2D",
"name": "screen_position",
"description": "Screen position"
}
],
"return": [
{
"type": "table",
"table_properties": [
{
"name": "Position",
"type": "Vector"
},
{
"name": "Direction",
"type": "Vector"
}
]
}
]
},
{
"name": "SetHardwareCursor",
"description": "Loads and sets a hardware cursor in the game from a PNG image",
"authority": "client",
"parameters": [
{
"type": "CursorType",
"name": "cursor_shape",
"description": ""
},
{
"type": "ImagePath",
"name": "cursor_path",
"description": "a PNG image relative to Assets/"
},
{
"type": "Vector2D",
"name": "hotspot",
"description": "",
"default": "Vector(0, 0)"
}
]
},
{
"name": "GetViewportSize",
"description": "Gets the size of viewport",
"authority": "client",
"return": [
{
"type": "Vector2D",
"description": "The size of viewport"
}
]
},
{
"name": "GetViewportScale",
"description": "Gets the scale of viewport",
"authority": "client",
"return": [
{
"type": "float",
"description": "The scale of viewport"
}
]
},
{
"name": "SetMousePosition",
"description": "Sets the mouse position",
"authority": "client",
"parameters": [
{
"type": "Vector2D",
"name": "new_position",
"description": ""
}
]
},
{
"name": "GetMousePosition",
"description": "Gets the current mouse screen location",
"authority": "client",
"return": [
{
"type": "Vector2D",
"description": "The current mouse screen location"
}
]
},
{
"name": "SetCrosshairEnabled",
"description": "Enables/Disables the Crosshair",
"authority": "client",
"parameters": [
{
"type": "boolean",
"name": "is_enabled",
"description": ""
}
]
},
{
"name": "SetBloodScreenEnabled",
"description": "Enables/Disables the Blood Screen effect",
"authority": "client",
"parameters": [
{
"type": "boolean",
"name": "is_enabled",
"description": ""
}
]
},
{
"name": "SetBloodScreenIntensity",
"description": "Manually sets the Blood Screen intensity",
"description_long": "If you want the Blood Screen to do not be overridden, disable it with <code>Client.SetBloodScreenEnabled(false)</code> before",
"authority": "client",
"parameters": [
{
"type": "float",
"name": "intensity",
"description": "From 0.0 to 1.0"
}
]
}
],
"events": [
{
"name": "Resize",
"description": "Called when the screen is resized",
"authority": "client",
"arguments": [
{
"type": "Vector2D",
"name": "new_size",
"description": "New new screen size"
}
]
}
]
}