Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, I am trying to pick up a (copy of a) billboard and drag it in a 2D-Overlay section. Can you give me a hint how to start so I have a ruff idea how this is working.. Thanks very much. KK |
||||
|
Particulary I dont know how to change this code for keyboard-input into mouse input for dragging: document. = function(event)The "if" section is giving me a hard time. Dont know what to paste there fordragging by mouse.. |
||||
|
It's basically the same, you have on MouseDown and on MouseMove events. In the MouseDown, store which node you are over and if you want to move it, in the mouseMove, move it if you clicked a node before you want to drag. If an on mouseup event happens, that means to stop dragging. |
||||
|
Thanks.. And sorry I am too stupid for this^^ I wish there would be an doc about it, as it is a FAQ. I would write a doc for you once you could help me out to get it running.. Maybe by a deeper hint?! Reg |
||||
|
Deeper Hint? Not sure what you want more. :) Ok, some code (didn't try it out, but it should work like this):
(note: some spaces inserted intentional in the function names, because this forum removes this code otherwise. Really need to fix this soon.) I didn't test that code so there might be bugs and typos, but it basically works like this. |
||||
|
Legendary!! You are the man! I owe you a lot.. I dig into it. Thanks |
||||
|
Cool!! I got it running without any problems.. Now, how could I drag several billboards? Since it picks a scenenode by its name ("yourbillboard") - I simply renamed all the others to this name as well.. But it doesn´t do the job. It lets you pick the very first node which was named like that and ignores all the others :( Adding another line to getSceneNodeFromName + altering the name doesn´t work either.. I wish dragging could be set in the behaviour Err.. and dropping of course |
||||
|
Hi.. any idea how to drag several billboards? Anyone? Its this line where to choose which node is dragged. cubeSceneNode = scene.getSceneNodeFromName('yourBillboard'); Giving all the other nodes the same name wouldn´t work. I need a way to tell several nodes to be dragged.. Can I tell a whole folder in the SceneGraph to be dragable? This would be what I want^^ Reg |
||||
|
Well, you need to program this. People won't write your program for you :) I suggest to use an array and to do the code above in a loop for all billboards you are interested in. |
||||
|
You are right^^ Thanks for the hint. I´ll be trying to solve this with some work-mates. As they are busy doing other stuff, we keep looking for a skilled C++/JS-coder.. Anyone want a job? Overseas is no problem^^ Thanks so far, Niko. I´ll get back to you.. Reg |
||||
|
Btw: Is there any chance to fire this dragging-script from the behaviour of a scenenode? So that it is taking its name by default and fires the script this way?! Just an idea.. Regards |
||||
|
Hm, would be an idea, but I don't think this will make it in the near future, because it is a very special feature and not much requested. |
|