I want to make a graphic package to generate graphics with x[] and y[] arrays.
I want the graphic to be inside the planet figure , FOR EXAMPLE.
And so the user should suppose to move the graphic around and zoom in and zoom out.
Problem’s :
A) You dont have a camera inside a table cell
B) You cant move the sprite
Small Example :
This should work once the graphic ( isFocused() == on )
if (Gdx.input.isKeyPressed(Input.Keys.A)) {
orthographicCamera.zoom = orthographicCamera.zoom + 0.01f;
}
if (Gdx.input.isKeyPressed(Input.Keys.D)) {
orthographicCamera.zoom = orthographicCamera.zoom - 0.01f;
}
if (Gdx.input.isKeyPressed(Input.Keys.S)) {
orthographicCamera.zoom = 1;
}
if (Gdx.input.isKeyPressed(Input.Keys.UP)) {
orthographicCamera.position.y = orthographicCamera.position.y + 0.1f;
}
if (Gdx.input.isKeyPressed(Input.Keys.DOWN)) {
orthographicCamera.position.y = orthographicCamera.position.y - 0.1f;
}
if (Gdx.input.isKeyPressed(Input.Keys.RIGHT)) {
orthographicCamera.position.x = orthographicCamera.position.x + 0.1f;
}
if (Gdx.input.isKeyPressed(Input.Keys.LEFT)) {
orthographicCamera.position.x = orthographicCamera.position.x - 0.1f;
}