MAEngine

Client APIs

Client-side Lua APIs for MAEngine

Client APIs

These APIs are available in client-side scripts (Client/init.lua).

Core

Input & Interaction

Game State (Read-Only)

Shared APIs

These are also available on client (identical to server):


Client Capabilities

The client handles rendering, input, and UI:

  • Input handling - Register and bind keyboard/mouse actions
  • WebUI - HTML/CSS/JS interfaces rendered over the game
  • Raycasting - Trace from camera or character
  • Local state - Read-only access to replicated entity state
-- Client/init.lua
Timer.Delay(0.5, function()
    local hud = WebUI.CreateAtScale("HUD", "index.html", 1)
    hud:SetFullscreen(true)
end)

Input.Register("Fire", "LeftMouseButton")
Input.Bind("Fire", Input.Pressed, function()
    local hit = Trace.FromCamera(10000)
    if hit.hit then
        Events.CallServer("PlayerFired", { target = hit.entity:GetID() })
    end
end)

On this page