gdl.context

Application

protocol

members

exit-app

(exit-app _)

ApplicationScreens

protocol

members

change-screen

(change-screen _ new-screen)
Calls screen/hide on the current-screen (if there is one).
Throws AssertionError when the context does not have a new-screen.
Calls screen/show on the new screen and
returns the context with current-screen set to new-screen.

current-screen

(current-screen _)

Assets

protocol

members

all-sound-files

(all-sound-files _)

all-texture-files

(all-texture-files _)

cached-texture

(cached-texture _ file)

Graphics

protocol

members

->color

(->color _ r g b a)

->cursor

(->cursor _ file hotspot-x hotspot-y)
Needs to be disposed.

delta-time

(delta-time _)
the time span between the current frame and the last frame in seconds.

frames-per-second

(frames-per-second _)
the average number of frames per second

set-cursor!

(set-cursor! _ cursor)

ImageCreator

protocol

members

create-image

(create-image _ file)

get-scaled-copy

(get-scaled-copy _ image scale)
Scaled of original texture-dimensions, not any existing scale.

get-sprite

(get-sprite _ {:keys [tilew tileh], :as sheet} [x y])

get-sub-image

(get-sub-image _ {:keys [file sub-image-bounds], :as image})
Coordinates are from original image, not scaled one.

spritesheet

(spritesheet _ file tilew tileh)

Input

protocol

members

button-just-pressed?

(button-just-pressed? _ button)

button-pressed?

(button-pressed? _ button)

key-just-pressed?

(key-just-pressed? _ k)

key-pressed?

(key-pressed? _ k)

SoundStore

protocol

members

play-sound!

(play-sound! _ file)
Sound is already loaded from file, this will perform only a lookup for the sound and play it.

Stage

protocol

members

->stage-screen

(->stage-screen _ {:keys [stage sub-screen]})
A screen with a stage as an input-processor which gets drawn and 'act'ed after the given sub-screen.
The stage will get disposed also.
Sub-screen is optional.

add-to-stage!

(add-to-stage! _ actor)

get-stage

(get-stage _)
Stage implements clojure.lang.ILookup (get) on actor id.

mouse-on-stage-actor?

(mouse-on-stage-actor? _)

TiledMapLoader

protocol

members

->tiled-map

(->tiled-map _ file)
Needs to be disposed.

TrueTypeFontGenerator

protocol

members

generate-ttf

(generate-ttf _ {:keys [file size]})

Widgets

protocol

members

->actor

(->actor _ {:keys [draw act]})

->button-group

(->button-group _ {:keys [max-check-count min-check-count]})

->check-box

(->check-box _ text on-clicked checked?)
on-clicked is a fn of one arg, taking the current isChecked state

->group

(->group _ {:keys [actors], :as opts})

->horizontal-group

(->horizontal-group _ {:keys [space pad]})

->image-button

(->image-button _ image on-clicked)(->image-button _ image on-clicked {:keys [dimensions]})

->image-widget

(->image-widget _ object opts)
Takes either an image or drawable. Opts are :scaling, :align and actor opts.

->label

(->label _ text)

->scroll-pane

(->scroll-pane _ actor)

->select-box

(->select-box _ {:keys [items selected]})

->split-pane

(->split-pane _ {:keys [first-widget second-widget vertical?], :as opts})

->stack

(->stack _ actors)

->table

(->table _ opts)

->text-button

(->text-button _ text on-clicked)

->text-field

(->text-field _ text opts)

->texture-region-drawable

(->texture-region-drawable _ texture-region)

->vertical-group

(->vertical-group _ actors)

->window

(->window _ {:keys [title modal? close-button? center?], :as opts})