snake5 icon

sgr editor entityspec

snake5 | PRO | 10/12/14 08:35:21 PM UTC | 0 ⭐ | 871 👁️ | Never ⏰ | []
JavaScript |

560 B

|

None

|

0 👍

/

0 👎

EDITOR_ENTITY
({
    name = "portal",
    params =
    [
        { name = "x", type = "position.x" },
        { name = "y", type = "position.y" },
        { name = "z", type = "position.z" },
        { name = "d", label = "Diameter", type = "float" },
        { name = "h", label = "Height", type = "float" },
    ],
    render =
    [
        { type = "icon", src = "icon_portal.png" },
        { type = "label", text = "PORTAL" },
        { type = "wire", render = function( ctx, data )
        {
            ctx.DrawCapsule( data.x, data.y, data.z - data.h * 0.5, data.x, data.y, data.z + data.h * 0.5, data.d * 0.5 );
        }},
    ],
});

Comments