mirror of
https://github.com/vlang/v.git
synced 2025-09-09 07:15:50 -04:00
examples: remove the setting of font_path from drag_n_drop.v and quadtree_demo.v (make them portable to Android + setting the font does not matter, for their goal)
This commit is contained in:
parent
cfa91d81d7
commit
f98e9d5757
@ -1,12 +1,10 @@
|
||||
module main
|
||||
|
||||
import os
|
||||
import gg
|
||||
import gx
|
||||
import sokol.sapp
|
||||
|
||||
const max_files = 12
|
||||
const text = 'Drag&Drop here max ${max_files} files.'
|
||||
const text_size = 16
|
||||
|
||||
struct App {
|
||||
@ -16,7 +14,6 @@ mut:
|
||||
}
|
||||
|
||||
fn main() {
|
||||
mut font_path := os.resource_abs_path(os.join_path('..', 'assets', 'fonts', 'RobotoMono-Regular.ttf'))
|
||||
mut app := &App{}
|
||||
app.gg = gg.new_context(
|
||||
bg_color: gx.rgb(174, 198, 255)
|
||||
@ -24,7 +21,6 @@ fn main() {
|
||||
height: 400
|
||||
window_title: 'Drag and drop'
|
||||
frame_fn: frame
|
||||
font_path: font_path
|
||||
user_data: app
|
||||
event_fn: my_event_manager
|
||||
// drag & drop
|
||||
@ -54,7 +50,7 @@ fn frame(mut app App) {
|
||||
align: .left
|
||||
size: int(text_size * app.gg.scale + 0.5)
|
||||
}
|
||||
app.gg.draw_text(12, 12, text, txt_conf)
|
||||
app.gg.draw_text(12, 12, 'Drag&Drop here max ${max_files} files.', txt_conf)
|
||||
|
||||
mut y := 40
|
||||
for c, f in app.dropped_file_list {
|
||||
|
@ -3,7 +3,6 @@ module main
|
||||
import datatypes
|
||||
import gg
|
||||
import gx
|
||||
import os
|
||||
import time
|
||||
import math
|
||||
import rand
|
||||
@ -123,7 +122,6 @@ fn main() {
|
||||
frame_fn: frame
|
||||
event_fn: on_event
|
||||
user_data: app
|
||||
font_path: os.resource_abs_path('../assets/fonts/RobotoMono-Regular.ttf')
|
||||
)
|
||||
app.qt = app.qt.create(0, 0, 1340, 640, 8, 4, 0)
|
||||
app.start()
|
||||
|
Loading…
x
Reference in New Issue
Block a user