oakes / play-clj

A Clojure game library
The Unlicense
939 stars 73 forks source link

Is this correct? #58

Closed zackp30 closed 9 years ago

zackp30 commented 9 years ago

Sorry if I put this in the wrong place, I'm currently having some issues with: https://gist.github.com/zackp30/8d128f8c6317f982f8bb

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.Exception: The keyword :align is not found.
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Caused by: java.lang.Exception: The keyword :align is not found.
    at play_clj.utils$throw_key_not_found.invoke(utils.clj:10)
    at play_clj.ui$eval1741$fn__1743.invoke(ui.clj:139)
    at clojure.lang.MultiFn.invoke(MultiFn.java:227)
    at play_clj.ui$add_BANG_.doInvoke(ui.clj:165)
    at clojure.lang.RestFn.applyTo(RestFn.java:139)
    at clojure.core$apply.invoke(core.clj:626)
    at play_clj.ui$create_group.invoke(ui.clj:170)
    at play_clj.ui$table_STAR_.invoke(ui.clj:525)
    at numberz.core$eval2052$fn__2072.invoke(core.clj:10)
    at clojure.lang.Var.invoke(Var.java:383)
    at play_clj.core$defscreen_STAR_$execute_fn_BANG___1471$fn__1474.invoke(core.clj:83)
    at clojure.lang.AFn.applyToHelper(AFn.java:152)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
    at clojure.lang.RestFn.invoke(RestFn.java:397)
    at play_clj.core$wrapper.invoke(core.clj:56)
    at play_clj.core$defscreen_STAR_$execute_fn_BANG___1471.doInvoke(core.clj:85)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at play_clj.core$defscreen_STAR_$fn__1497.invoke(core.clj:113)
    at clojure.lang.AFn.applyToHelper(AFn.java:152)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.core$apply.invoke(core.clj:624)
    at play_clj.core$set_screen_BANG_$run_fn_BANG___1527.doInvoke(core.clj:523)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at play_clj.core$set_screen_BANG_$reify__1535.show(core.clj:528)
    at com.badlogic.gdx.Game.setScreen(Game.java:61)
    at play_clj.core.proxy$com.badlogic.gdx.Game$ff19274a.setScreen(Unknown Source)
    at play_clj.core$set_screen_BANG_.doInvoke(core.clj:524)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at numberz.core$eval2090$fn__2091.invoke(core.clj:20)
    at play_clj.core$defgame_STAR_$fn__1516.invoke(core.clj:508)
    at play_clj.core.proxy$com.badlogic.gdx.Game$ff19274a.create(Unknown Source)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
oakes commented 9 years ago

Looks like you have an extra set of brackets. Try this:

(table [(label "HI" (color :red))]
  :align (align :center))
zackp30 commented 9 years ago

Aha! Thanks! Now it launches! :smile: However, it is now on the far bottom left (i.e: barely visible), what exactly would I do to prevent this?

oakes commented 9 years ago

If you want it to fill the screen, try adding :set-fill-parent true after the align stuff.

zackp30 commented 9 years ago

Works! Thanks, and sorry to bother you. :smile:

oakes commented 9 years ago

Great, no problem.