mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00

Some checks failed
Graphics CI / gg-regressions (push) Waiting to run
vlib modules CI / build-module-docs (push) Waiting to run
native backend CI / native-backend-ubuntu (push) Waiting to run
vab CI / v-compiles-os-android (push) Waiting to run
native backend CI / native-backend-windows (push) Waiting to run
Shy and PV CI / v-compiles-puzzle-vibes (push) Waiting to run
Sanitized CI / sanitize-undefined-clang (push) Waiting to run
Sanitized CI / sanitize-undefined-gcc (push) Waiting to run
Sanitized CI / tests-sanitize-address-clang (push) Waiting to run
Sanitized CI / sanitize-address-msvc (push) Waiting to run
Sanitized CI / sanitize-address-gcc (push) Waiting to run
Sanitized CI / sanitize-memory-clang (push) Waiting to run
sdl CI / v-compiles-sdl-examples (push) Waiting to run
Time CI / time-linux (push) Waiting to run
Time CI / time-macos (push) Waiting to run
Time CI / time-windows (push) Waiting to run
toml CI / toml-module-pass-external-test-suites (push) Waiting to run
Tools CI / tools-linux (clang) (push) Waiting to run
Tools CI / tools-linux (gcc) (push) Waiting to run
Tools CI / tools-linux (tcc) (push) Waiting to run
Tools CI / tools-macos (clang) (push) Waiting to run
Tools CI / tools-windows (gcc) (push) Waiting to run
Tools CI / tools-windows (msvc) (push) Waiting to run
Tools CI / tools-windows (tcc) (push) Waiting to run
Tools CI / tools-docker-ubuntu-musl (push) Waiting to run
vab CI / vab-compiles-v-examples (push) Waiting to run
wasm backend CI / wasm-backend (ubuntu-22.04) (push) Waiting to run
wasm backend CI / wasm-backend (windows-2022) (push) Waiting to run
Workflow Lint / lint-yml-workflows (push) Has been cancelled
27 lines
907 B
V
27 lines
907 B
V
module gg
|
|
|
|
import sokol.sgl
|
|
|
|
// Stuff for ui from now for screenshot (that would be interesting for gg if screenshot is implemented also for gg)
|
|
|
|
// required for ui.DrawDevice interface (with &gg.Context as an instance)
|
|
pub fn (ctx &Context) scissor_rect(x int, y int, w int, h int) {
|
|
sgl.scissor_rect(int(ctx.scale * x), int(ctx.scale * y), int(ctx.scale * w), int(ctx.scale * h),
|
|
true)
|
|
}
|
|
|
|
// empty function
|
|
pub fn (ctx &Context) has_text_style() bool {
|
|
return false
|
|
}
|
|
|
|
// empty function
|
|
pub fn (ctx &Context) set_text_style(font_name string, font_path string, size int, color Color, align int,
|
|
vertical_align int) {
|
|
}
|
|
|
|
// default draw_text (draw_text_def but without set_text_cfg)
|
|
pub fn (ctx &Context) draw_text_default(x int, y int, text string) {
|
|
scale := if ctx.ft.scale == 0 { f32(1) } else { ctx.ft.scale }
|
|
ctx.ft.fons.draw_text(x * scale, y * scale, text) // TODO: check offsets/alignment
|
|
}
|