aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/03-font-render.lisp
blob: 6e1637a16c6c506af7ce905d4727107a265f0e53 (plain)
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
37

(defpackage #:ww.example/3
  (:use :cl))

(in-package #:ww.example/3)


(defclass font-display (ww::application) ())

(defmethod ww::boot ((app font-display))
  (let ((hello
          (make-instance
           'ww::text
           :content "Hell! Oh World..."
           :font (ww::get-asset "Ticketing.ttf" :asset-args '(:oversample 2)))))

    (setf (ww::unit-width hello)
          (* 5 (ww::unit-width hello))

          (ww::unit-height hello)
          (* 5 (ww::unit-height hello))

          (ww::unit-x hello) 100

          (ww::unit-y hello) 100)

    (ww::add-unit app hello)))


(defun start ()
  (ww::start (make-instance 'font-display
                            :title "Wheelwork Example: Font display"
                            :asset-root "~/projects/wheelwork/examples/")))