mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
gg: add text rendering, keyboard event handling for JS and other fixes (#12932)
This commit is contained in:
9
vlib/gg/text_rendering.js.v
Normal file
9
vlib/gg/text_rendering.js.v
Normal file
@@ -0,0 +1,9 @@
|
||||
module gg
|
||||
|
||||
import gx
|
||||
|
||||
pub fn (mut ctx Context) draw_text(x int, y int, text_ string, cfg gx.TextCfg) {
|
||||
ctx.context.fillStyle = cfg.color.to_css_string().str
|
||||
ctx.context.font = cfg.to_css_string().str
|
||||
ctx.context.fillText(text_.str, x, y)
|
||||
}
|
Reference in New Issue
Block a user