Files
aego/modules/debug/res/docs/api.ru.md
sanspie f22242e5aa
ci / release (push) Successful in 5m5s
ci-platforms / build (amd64, windows, windows-2022) (push) Skipped
ci-platforms / build (arm64, darwin, macos-15) (push) Skipped
ci-platforms / build (amd64, darwin, macos-15-intel) (push) Skipped
ci / checks (push) Successful in 4m41s
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 7m14s
Stage 11g2–11g3: registry texts, CLI and the site in Russian (D348)
The remaining editor strings and undo step names; component, field, enum, setting, diagnostic and Script API texts under schema.*, enum.*, setting.*, diag.* and api.*; the launcher, the in-game Settings View with a Language setting, the CLI and aego schema show --lang. Every documentation page has a .ru.md translation; the site has a full Russian tree with hreflang, a language switch and ru/llms.txt; aego docs check --lang ru. New doc.tutorial and doc.recipe icons. Fix: an animator restored by a rewind prepares its controller before the replayed step.
2026-10-25 15:31:22 +03:00

1.6 KiB

id, summary
id summary
aego/debug Рисует поверх игры линии, стрелки, окружности, прямоугольники, крестики и подписи для отладки.

Фигуры живут один кадр, если Pen не задаёт им время жизни. Каждая фигура принадлежит каналу, который панель «Отладочная отрисовка» включает и выключает. В песочнице документации ничего не рисуется; пример пишет в лог, что он рисует. См. Отладочная отрисовка.

Пример

package demo

import (
    "aego/debug"
    "aego/log"
)

script Patrol {
    @export var Goal Vec2 = Vec2{4, 0}
    @export var Speed float = 2

    var frames int

    func Ready() {
        debug.Pen("ai.goal", -1)
        debug.Cross(Goal, 0.5, Color{1, 0, 1, 1})
        debug.Rect(Rect{-1, -1, 6, 2}, Color{1, 1, 1, 1})
    }

    func Update(dt float) {
        p := node.WorldPosition()
        step := Vec2{Speed * dt, 0}
        if p.X < Goal.X {
            node.SetPosition(node.Position() + step)
        }
        debug.Pen("ai.path", 0)
        debug.Arrow(p, Goal, Color{0, 1, 0, 1})
        debug.Circle(p, 0.5, Color{0, 0.6, 1, 1})
        debug.Text(p, "x " + string(p.X), Color{1, 1, 1, 1})
        frames++
        if frames % 30 == 0 {
            log.Info("drawing at x=" + string(p.X))
        }
        if frames == 90 {
            debug.Clear("ai")
            log.Info("cleared the ai channels")
        }
    }
}