Complex made simpleThis library allows you to create objects in space (“markers”) in a very simple manner, to speed up development of other very useful addons. It can create “2D” and “3D” markers, automatically handles correct position and order of drawing (to avoid overlapping of distant markers on top of close ones). Check the description below and ImperialCartographer for more information!DependenciesNo external dependencies, but you can use LibDebugLogger if you are interested in logs (use “LibImplex” to filter logs)LibDebugLoggerYou can find a detailed description under the spoiler below (skip if you’re only interested in API description).It creates markers?Yes, I call them “markers”, but it actually creates XML controls and they can be used as you want. The most common use case so far – to place a simple marker at a particular position in space, so I use the word “marker” to describe created objects. Will probably generalize it in the future :)How can I use them?You’re probably familiar with great addons like OdySupportIcons and Elm’s Markers – this library can help create similar looking markers with extra features. And it simplifies things a lot.2D and 3D markers?There are two main approaches to “place” objects in space and draw them on the screen.Calculate vector from camera position to object position and project it on the screen, draw some texture at this point on the screen. It needs to be updated every frame (ideally, for maximum smoothing), because camera follows character and vector camera->object and view perspective changes each frame. This is how OdySupportIcons works, and some other addons use Ody’s addon to draw markers (e.g. Elm’s Markers). I call these markers “2D”, because it’s basically a flat texture on the screen at the right position.Use built-in 3D render and related functions. I call these “3D”, because game’s 3D render is used (but it can’t draw 3D models due to limitations, don’t mix things up).Both methods have their own pros and cons!But what’s the difference from Ody’s addon then?Implemented from scratch with much simpler math and additional features in mindTwo types of markers (2D and 3D) implemented for any use case you can think ofMaximum flexibility – you can add different update functions for each marker: to make them fade away, change size, etc.Basic update functions already implemented, so you can use them right awayYou can add handlers for start and end of update cycleCreated with performance in mind – it takes ~300μs to update 100 2D markers with labels (pretty heavy task), which is why I decided to make it update every frame without limit (OdySupportIcons uses 100fps limit by default), resulting in smoother experience. This can be changed in the future, as not every PC has the same computation power, but I performed tests on a laptop with Power Saving mode on, so I assumed average PC can handle this flawlesslyAPI descriptionCreation of 3D marker:local Marker = LibImplex.Markerlocal position = {111, 222, 333} — some point in spacelocal orientation = nil — 2D marker is flat and can’t be orientedtexture = ‘some/texture/file.dds’size = {width, height} — in pixelscolor = {0.4, 0.5, 0.6} — RGBlocal marker = Marker.Marker2D(position, orientation, texture, size, color)After color you can pass as many update functions as you wish. Update functions make changes to marker on each update (size, alpha, etc.)– update function must have these parameters– “marker” – marker itself, use it to access marker control and apply changes to control– “distance” – calculated distance from player to marker, in cm– “pX, pY, pZ” – x, y, z components of player vector– “fX/Y/Z, rX/Y/Z, uX/Y/Z” – x, y, z components of front, right and up camera vectors, you can use them for calculationslocal function updateFunction1(marker, distance, pX, pY, pZ, fX, fY, fZ, rX, rY, rZ, uX, uY, uZ)– let’s make marker disappear if it is further than 100m or 10000cm marker.control:SetHidden(distance > 10000)endlocal marker = Marker.Marker2D( position, orientation, texture, size, color, updateFunction1, — updateFunction2, — …..)You can destroy marker like this:marker:Delete()All you need to do to place 3D marker – change Marker2D to Marker3D. You can use same update functions and you can destroy it via Delete as well.local Marker = LibImplex.Markerlocal PI = math.pilocal position = {111, 222, 333} — some position pointlocal orientation = {PI, PI / 2, 0} — orient as you wanttexture = ‘some/texture/file.dds’size = {width, height} — in meters! {1, 1}, {1.5, 1.5}, etccolor = {0.4, 0.5, 0.6} — RGBlocal marker = Marker.Marker3D(position, orientation, texture, size, color, updateFunction1)marker:Delete()That’s it! Simple. The lib will take care of updating markers and draw order.I’m working on some other features and will describe them a bit later :)ContactsYou can send me feedback via Discord (@impda) or you can join conversation on the forum.RoadmapImplement ‘Strings’ and ‘Text’, add to the description