You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The vertices table contains `Vector`s with the position of each vertex of the polygon **RELATIVE** to the starting position. The starting position will be automatically added to each vertex position, doing so manually will lead to unexpected results.
236
+
A minimum of 2 vertices (which would result in a line) are required to draw a polygon primitive. A console error will be printed and drawing will be skipped if less are provided.
237
+
There may be a limit for the number of vertices in `PolygonFillPrimitive` because it has different handling but it was not reached during testing.
238
+
239
+
The order of vertices is of high importance. Bad ordering will lead to unexpected results.
240
+
For example: `{ Vector(10, 0), Vector(10, 10), Vector(0, 10), Vector(0, 0) }` will result in a square, while `{ Vector(10, 0), Vector(0, 10), Vector(10, 10), Vector(0, 0) }` will result in an hourglass shape.
241
+
Note that **all** vertices of the shape must be specified, as the last vertex will be connected to the first vertex and not to the starting position (whether it is used as center or as a corner) to complete the shape.
242
+
Omitting the last `Vector(0, 0)` in the above example would result in a right angle triangle.
243
+
244
+
**The `Vector`s in the vertices table are single use! They will be deleted after being drawn, so they cannot be re-used!**
- Added blended drawing functions to `PrimitiveMan`:
266
+
There are 10 blending modes available to produce different color and transparency effects for both true primitives and bitmap based primitives.
267
+
Blended drawing effects are not the same as post-processing (glows), as they are all drawn in indexed color mode and will produce widely different results.
268
+
269
+
**Note that blended drawing is very expensive and chugs FPS like no tomorrow. It should not be abused!**
This is the fully fledged blended drawing function which allows individual control over each color channel blend amount.
275
+
Blend amounts are in percentages, where 0 means no blending and 100 means full blending (e.g. `blendAmountA = 100` will result in a fully transparent primitive, as if it was not drawn at all).
276
+
The blend mode and amounts will be applied to all the primitives in the primitive table.
277
+
Note that blend amounts are internally rounded to multiples of 5 (e.g. 32 will round to 30, 33 will round to 35) to reduce memory usage and because smaller steps are hardly noticeable.
- New `Vector` Lua (R/O) property `SqrMagnitude` which returns the squared magnitude of the `Vector`.
212
363
Should be used for more efficient comparison with `vector.SqrMagnitude > (floatValue * floatValue)` over `vector.Magnitude > floatValue`.
213
364
@@ -308,7 +459,9 @@ This can be accessed via the new Lua (R/W) `SettingsMan` property `AIUpdateInter
308
459
When UPS is capped at the target, FPS will be greater than UPS because there is enough time to perform multiple draws before it is time for the next sim update.
309
460
Results will obviously vary depending on system performance.
310
461
311
-
- Added `LuaMan` Lua functions `GetDirectoryList(pathToGetDirectoryNamesIn)` and `GetFileList(pathToGetFileNamesIn)`, that get the names of all directories or files at the specified file path.
462
+
- Added `LuaMan` Lua functions `GetDirectoryList(pathToGetDirectoryNamesIn)` and `GetFileList(pathToGetFileNamesIn)`, that get the names of all directories or files at the specified file path.
463
+
464
+
- Added a new Lua scripted function for `Actor`s: `OnControllerInputModeChange(self, previousControllerMode, previousControllingPlayer)` that triggers when an `Actor`'s `Controller`'s input state changes (between AI/Player/Network control etc). This provides a script hook that fires when a player starts/stops controlling an `Actor`.
312
465
313
466
- Added `ACrab` INI properties for setting individual foot `AtomGroup`s, as opposed to setting the same foot `AtomGroup`s for both `Legs` on the left or right side.
314
467
These are `LeftFGFootGroup`, `LeftBGFootGroup`, `RightFGFootGroup` and `RightBGFootGroup`.
@@ -319,6 +472,9 @@ This can be accessed via the new Lua (R/W) `SettingsMan` property `AIUpdateInter
319
472
320
473
- Added Lua access (R/W) to `Attachable` property `DeleteWhenRemovedFromParent`, which determines whether the given `Attachable` should delete itself when it's removed from its current parent.
321
474
475
+
- Added Lua convenience function `RoundToNearestMultiple(num, multiple)` which returns a number rounded to the nearest specified multiple.
476
+
Note that this operates on integers, so fractional parts will be truncated towards zero by type conversion.
477
+
322
478
</details>
323
479
324
480
<details><summary><b>Changed</b></summary>
@@ -470,6 +626,9 @@ As such, the `Index.ini` property `SupportedGameVersion` must now be a valid sem
470
626
471
627
Mods published for any development builds must match that development version exactly.
472
628
629
+
-`BitmapPrimitive` drawing functions now accept `MOSprite` instead of `Entity` for the object they get the bitmap to draw from.
630
+
This changes nothing regarding the bindings, but will now print an error to the console when attempting to draw a non-`MOSprite` based object (e.g. `MOPixel`), instead of silently skipping it.
0 commit comments