Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

libgdx move camera with touch

@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
    //difference between the current pointer location and the last pointer location on X axis
    float x = Gdx.input.getDeltaX();
    //difference between the current pointer location and the last pointer location on Y axis
    float y = Gdx.input.getDeltaY();

    camera.translate(-x,y);
    return true;
}
Comment

PREVIOUS NEXT
Code Example
Java :: fullscreen jframe 
Java :: Could not find method compile() 
Java :: javaee jsp convert int to string 
Java :: keytool error: java.lang.Exception: Keystore file does not exist: ~/.android/debug.keystore 
Java :: pytho count avro file 
Java :: getcurrencyinstance java india 
Java :: duck number in java 
Java :: how to print elements in matrix java 
Java :: add days to date java 
Java :: void set method using collections 
Java :: new int [] in java with assigned values 
Java :: Bootstrap 4 Navbar Dropdown Menu Items Right 
Java :: java get specific element from arraylist 
Java :: java double 2 decimal 
Java :: java 8 remove spaces from string 
Java :: spring config.xml file 
Java :: Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available jks 
Java :: convert list to map java 
Java :: xAxis.setTextSize() text gets clipped 
Java :: java localdate zoneid example 
Java :: java remove from arraylist while iterating 
Java :: assertthat code throws exception 
Java :: cors filter spring boot 
Java :: how to clear activity stack in android 
Java :: how to preset a list java 
Java :: american heavy tanks of ww2 
Java :: topological sort java 
Java :: jlist set selected value 
Java :: how to declare list of object in java as constant 
Java :: find duplicate value in array java 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =