How to get a click on a object?

6 views
Skip to first unread message

philip

unread,
Oct 15, 2011, 8:51:31 AM10/15/11
to sgine-dev

Hi Matt,

Referring to this:
http://code.google.com/p/sgine/source/browse/render/src/example/scala/org/sgine/render/RotationTest.scala

How can I add a listener to intercept a mouse click on the object ?

Is the update method the place where I should do calculations to move
my objects, game logic, etc?

render method just sends the objects to the OpenGL?

Thanks, Phil

philip

unread,
Oct 15, 2011, 9:17:40 AM10/15/11
to sgine-dev

worked out this much - what comes next?

Mouse.mouseEvent += EventHandler()(processMouseEvent _)

private def processMouseEvent(evt: MouseEvent) = {
val pickTest = (mc: MatrixComponent) => {
}
println("mouse" + evt.state)
}


On Oct 15, 8:51 pm, philip <philip14...@gmail.com> wrote:
> Hi Matt,
>
> Referring to this:http://code.google.com/p/sgine/source/browse/render/src/example/scala...

Hicks, Matt

unread,
Oct 15, 2011, 9:48:07 AM10/15/11
to sgin...@googlegroups.com
Philip,

Unfortunately the mouse picking functionality hasn't been implemented in the trunk yet.  I've actually been considering the idea of switching the Sgine to build upon libgdx so that I don't have to deal with all of these items as I still lack a lot of the knowledge necessary to do this right.  If you are interested in implementing the functionality and contributing that would be awesome.

Sorry I'm not more help here.

-Matt

philip

unread,
Oct 17, 2011, 4:33:40 AM10/17/11
to sgine-dev
Hi Matt,

I wish I could make the time to contribute, but I can't sadly.

Hope you wrap libdgx as it seems to have some good features but Sgine
has some good Scala abstractions.

Thanks, Philip

On Oct 15, 9:48 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
Reply all
Reply to author
Forward
0 new messages