-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.swift
36 lines (27 loc) · 825 Bytes
/
App.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// File.swift
//
//
// Created by Christophe Bronner on 2021-12-26.
//
import RaylibKit
@main struct DropFiles: Applet {
init() {
Window.create(800, by: 450, title: "Example - Core - Drop Files")
Application.target(fps: 60)
}
func update() {
DragAndDrop.refresh()
}
func draw() {
Renderer2D.text("Drop your files to this window!", at: 100, 40, size: 20, color: .darkGray)
for (i, path) in DragAndDrop.paths.enumerated() {
Renderer2D.rectangle(at: 0, 85 + 40 * i, size: Window.width, 40, color: .lightGray.faded(to: i % 2 == 0 ? 0.5 : 0.3))
Renderer2D.text(path.description, at: 120, 100 + 40 * i, size: 10, color: .gray)
}
Renderer2D.text("Drop new files...", at: 100, 110 + 40 * DragAndDrop.paths.count, size: 20, color: .darkGray)
}
func unload() {
DragAndDrop.clear()
}
}