java - libGDX - Scrolling background by dragging mouse -


I am trying to use a mouse-scroll background to use libGDX. I have already created an infinite loop in the background, but I do not know how to scroll it by dragging the mouse. Is the proto processor the only way to make it or is there any easy way? If so, do you know any tutorials about using mouse dropping method in the embed processor? I'm just a knot with LGGDX, so if possible give a specific answer.

a gesture listener

PAN: A user Draws a finger on the screen. The detector will report the current touch coordinates as well as the delta between current and previous touch positions. Useful for implementing camera panning in 2D

  @ Override public boolean pan (float x, float y, float deltaax, float delta) {camera.position.x + = deltaX; Camera.update (); return false; }  

With this code you are about to move your mouse whenever you drag your mouse (finger on device)

read the link from the document.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -