oakes / play-clj

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

input->screen throws an exception if no :camera is defined #18

Closed Misophistful closed 10 years ago

Misophistful commented 10 years ago
"java.lang.Exception: The keyword :camera is not found."
"play_clj.utils$throw_key_not_found.invoke(utils.clj:9)"
"play_clj.utils$get_obj.invoke(utils.clj:15)"
"play_clj.core$input__GT_screen.invoke(core_graphics.clj:281)"
"play_clj.core$input__GT_screen.invoke(core_graphics.clj:289)"
"elemental.elements$get_element_at_cursor.invoke(elements.clj:27)"
"elemental.core$eval6822$fn__6852.invoke(/Users/jamtru/Projects/clojure/elemental/desktop/src-common/elemental/core.clj:29)"
"clojure.lang.Var.invoke(Var.java:383)"
"play_clj.core$defscreen_STAR_$execute_fn_BANG___827$G__829__830.invoke(core.clj:57)"
"elemental.core$eval6899$fn__6900.invoke(/Users/jamtru/Projects/clojure/elemental/desktop/src-common/elemental/core.clj:45)"
"play_clj.core$defscreen_STAR_$execute_fn_BANG___827.doInvoke(core.clj:58)"
"clojure.lang.RestFn.invoke(RestFn.java:713)"
"play_clj.core$input_processor$reify__643.touchDown(core_listeners.clj:26)"
"com.badlogic.gdx.InputMultiplexer.touchDown(InputMultiplexer.java:88)"
"com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents(LwjglInput.java:302)"
"com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:199)"
"com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)"

This probably isn't a big problem, as I'm sure most people are defining their :camera straight away. However, I thought I'd let you know about it anyway.

oakes commented 10 years ago

Yeah, right now it's using the camera to do the conversion, but now that you mention it I think it would make sense to make it work without one. I suppose that would simply mean flipping the y-axis, so I'll add that pretty soon.

oakes commented 10 years ago

Fixed in the latest 0.3.1-SNAPSHOT.