灵符lingfu

lingdev

↓ 0 下载

LingDev: a Godot / Unity-style game editor written in Ling. 2-D and 3-D scenes, Flash-style timeline and cutscenes, HUDs over 3-D, Ling scripting, audio / music / MIDI, builds for Windows, Linux, macOS, web, Raspberry Pi and LingOS. Ships with Ling Agent (an N64-style spy FPS), Ling Breaker (a 3-D breakout) and Moko's Picture Book (a kawaii storybook platformer).

Windows · x86-64Linux · x86-64LingOS · x86-64LingOS · Pi 5 ARM64Web · WASM
关键词 game-engine, editor, 3d, 2d, cutscene, timeline, ling, lingos, raspberry-pi
lingfu install lingdev
许可证Apache-2.0 OR MIT
作者ling-lin
README代码 / 文件版本依赖关系图依赖此包的项目安全构建设置

代码 / 文件 (136)

ling/console.ling
# console.ling - the log panel: status history, build output notes, scene statistics.

fn log(msg) {
    st_lpush("log", fmt_time(st_get("now", 0.0)) + "  " + msg)
    while st_llen("log") > 400.0 { st_ldel("log", 0.0) }
    st_set("log_scroll", 999999.0)
}

fn console_panel(x, y, w, h) {
    g_rect(x, y, w, h, C_BG_DEEP)
    bind st = st_get("status", "")
    if st != st_get("log_last_status", "") && st != "" {
        st_set("log_last_status", st)
        log(st)
    }
    bind n = st_llen("log")
    bind rh = 16.0
    bind off = u_scroll_y("log_sb", x, y, w, h - 28.0, n * rh + 8.0, st_get("log_scroll", 0.0))
    st_set("log_scroll", off)
    u_clip(x, y, w, h - 28.0)
    bind i = 0.0
    while i < n {
        bind ly = y + 4.0 + i * rh - off
        if ly + rh >= y && ly <= y + h { g_text_fit(x + 10.0, ly, w - 30.0, 11.0, sel(i == n - 1.0, C_TEXT_STRONG, C_TEXT), st_lget("log", i)) }
        bind i = i + 1.0
    }
    if n < 0.5 { g_text(x + 10.0, y + 8.0, 11.0, C_TEXT_DIM, "Status messages, build notes and play-mode output appear here.") }
    u_unclip()
    g_rect(x, y + h - 28.0, w, 28.0, C_BG_PANEL)
    u_hsep(x, y + h - 28.0, w)
    if u_button("log_clear", x + 8.0, y + h - 24.0, 70.0, 20.0, "Clear", 0.0) { st_lclear("log") }
    bind info = "scene " + sc_get("name", "") + "  kind " + sc_get("kind", "") + "  nodes " + num_str(nd_count()) + "  keys " + num_str(key_count()) + "  clips " + num_str(clip_count()) + "  undo " + num_str(st_llen("undo"))
    g_text_fit(x + 90.0, y + h - 20.0, w - 100.0, 11.0, C_TEXT_DIM, info)
}

← 返回索引