Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Solved] Libgdx Box2d Scaling  (Read 3573 times)
0 Members and 1 Guest are viewing this topic.
Offline Tinhorn

Senior Member


Medals: 1
Projects: 3



« Posted 2013-06-25 03:32:13 »

Ok So this is just a "protoype" code

It is supposed to have a bouncing ball and it works.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
package com.Fawaz.Tut;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.CircleShape;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.scenes.scene2d.Stage;



 public class Box2d implements ApplicationListener {
    OrthographicCamera camera;
    World world;
    Box2DDebugRenderer renderer;
    Sprite Circle;
    float width, height;
   CircleShape circleShape;
    FPSLogger logger;
   
    Body circleBody;
   
   @Override
   public void create() {
     
     
   }

   @Override
   public void resize(int width, int height) {
     
      Circle = new Sprite(new Texture(Gdx.files.internal("data/Circle.png")));
      camera = new OrthographicCamera(width,height);
      camera.position.set(width /2 , height / 2, 0);
      camera.update();
     
      world = new World(new Vector2(0, -9.8f), false);
     
      renderer = new Box2DDebugRenderer();
     
      logger = new FPSLogger();
     
      BodyDef circleDef = new BodyDef();
      circleDef.type = BodyType.DynamicBody;
      circleDef.position.set(width/2, height/2);
      circleBody = world.createBody(circleDef);
     
      circleShape = new CircleShape();
      circleShape.setRadius(45);
     
      FixtureDef circleFixture = new FixtureDef();
      circleFixture.shape = circleShape;
      circleFixture.density = 0.4f;
      circleFixture.friction = 0.2f;
      circleFixture.restitution = 1;
     
      circleBody.createFixture(circleFixture);
      circleBody.setUserData(Circle);
     
      BodyDef groundDef = new BodyDef();
      groundDef.position.set(0, 3);
     
      Body groundBody = world.createBody(groundDef);
     
     
      PolygonShape groundBox = new PolygonShape();
     
      groundBox.setAsBox(camera.viewportWidth * 2, 0);
      groundBody.createFixture(groundBox, 0);
     
   }

   @Override
   public void render() {
      Sprite sprite;
      SpriteBatch batch = new SpriteBatch();
      Gdx.gl.glClearColor(0, 0, 0, 1);
      Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
     
      renderer.render(world, camera.combined);
     
      batch.begin();
      sprite = (Sprite) circleBody.getUserData();
      sprite.setPosition(circleBody.getPosition().x - (sprite.getWidth() /2) , circleBody.getPosition().y - (sprite.getHeight()/2));
      sprite.setSize(45*2, 45*2);
      sprite.draw(batch);
      batch.end();

     
      world.step(1/45f, 6, 2);
     
      logger.log();
     
   }

   @Override
   public void pause() {
     
     
   }

   @Override
   public void resume() {
     
     
   }

   @Override
   public void dispose() {
   world.dispose();
     
   }  
     
 }  


Now this works as it produces this


But the question is should i scale from pixel to meters
or is this perfectly fine
and if i should

Should you tell me how that would go

Offline heisenbergman

JGO Coder


Medals: 14


L___ o_ G___ a__ P___


« Reply #1 - Posted 2013-06-25 03:50:11 »

From the Box2D v2.2.0 User Manual:

Quote
1.7 Units

Box2D works with floating point numbers and tolerances have to be used to make Box2D perform well. These tolerances have been tuned to work well with meters-kilogram-second (MKS) units. In particular, Box2D has been tuned to work well with moving objects between 0.1 and 10 meters. So this means objects between soup cans and buses in size should work well. Static objects may be up to 50 meters big without too much trouble.

Being a 2D physics engine, it is tempting to use pixels as your units. Unfortunately this will lead to a poor simulation and possibly weird behavior. An object of length 200 pixels would be seen by Box2D as the size of a 45 story building.

Quote
Caution

Box2D is tuned for MKS units. Keep the size of moving objects roughly between 0.1 and 10 meters. You'll need to use some scaling system when you render your environment and actors. The Box2D testbed does this by using an OpenGL viewport transform. DO NOT USE PIXELS.

It is best to think of Box2D bodies as moving billboards upon which you attach your artwork. The billboard may move in a unit system of meters, but you can convert that to pixel coordinates with a simple scaling factor. You can then use those pixel coordinates to place your sprites, etc.

Box2D uses radians for angles. The body rotation is stored in radians and may grow unbounded. Consider normalizing the angle of your bodies if the magnitude of the angle becomes too large (use b2Body::SetAngle).

^ Considering this, I think that as much as possible, scale your units down to what is optimal for Box2D. Don't use 1 meter = 1 pixel. Personally, I use 1 meter = 32 pixels.

In your example, that circle that you have bouncing is seen by Box2d as having an area almost 15 times the size of Vatican City Tongue

Offline Tinhorn

Senior Member


Medals: 1
Projects: 3



« Reply #2 - Posted 2013-06-25 03:54:44 »

Thanks man

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Tinhorn

Senior Member


Medals: 1
Projects: 3



« Reply #3 - Posted 2013-06-25 06:15:23 »

Ok so as expected something went wrong.   Emo
I used the conversion 32 pixels equal one meter

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
package com.Fawaz.Tut;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.CircleShape;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.scenes.scene2d.Stage;



 public class Box2d implements ApplicationListener {
    OrthographicCamera camera;
    World world;
    Box2DDebugRenderer renderer;
    Sprite Circle;
    CircleShape circleShape;
    FPSLogger logger;
    private float PIXELS_TO_METERS = .3125f;
    private float METERS_TO_PIXELS = 32f;
   
    private float convertToMETERS(float x){
       return x * PIXELS_TO_METERS;
    }
   
    private float convertToPIXELS(float x){
       return x * METERS_TO_PIXELS;
    }
    Body circleBody;
   
   @Override
   public void create() {
     
     
   }

   @Override
   public void resize(int width, int height) {
     
      Circle = new Sprite(new Texture(Gdx.files.internal("data/Circle.png")));
      camera = new OrthographicCamera(5,5);
      camera.position.set(3.5f, 3.5f, 0);
      camera.update();
      Circle.setPosition(3.5f, 3.5f);
     
      world = new World(new Vector2(0, -9.8f), false);
     
      renderer = new Box2DDebugRenderer();
     
      logger = new FPSLogger();
     
      BodyDef circleDef = new BodyDef();
      circleDef.type = BodyType.DynamicBody;
      circleDef.position.set(3.5f, 3.5f);
      circleBody = world.createBody(circleDef);
     
      circleShape = new CircleShape();
      circleShape.setRadius(.2f);
     
      FixtureDef circleFixture = new FixtureDef();
      circleFixture.shape = circleShape;
      circleFixture.density = 0.4f;
      circleFixture.friction = 0.2f;
      circleFixture.restitution = 1;
     
      circleBody.createFixture(circleFixture);
      circleBody.setUserData(Circle);
     
     
      BodyDef groundDef = new BodyDef();
      groundDef.position.set(0, 1);
     
      Body groundBody = world.createBody(groundDef);
     
     
      PolygonShape groundBox = new PolygonShape();
     
      groundBox.setAsBox(camera.viewportWidth * 2, 0);
      groundBody.createFixture(groundBox, 0);
     
   }

   @Override
   public void render() {
      Sprite sprite;
      SpriteBatch batch = new SpriteBatch();
      Gdx.gl.glClearColor(0, 0, 0, 1);
      Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
     
      renderer.render(world, camera.combined);
     
      batch.begin();
      sprite = (Sprite) circleBody.getUserData();
      sprite.setSize(convertToPIXELS(.2f), convertToPIXELS(.2f));
      sprite.setPosition(convertToPIXELS(circleBody.getPosition().x) - (sprite.getWidth() /2) , convertToPIXELS(circleBody.getPosition().y) - (sprite.getHeight()/2));
      sprite.draw(batch);
      Circle.draw(batch);
      batch.end();

     
      world.step(1/45f, 6, 2);
     
      logger.log();
     
   }

   @Override
   public void pause() {
     
     
   }

   @Override
   public void resume() {
     
     
   }

   @Override
   public void dispose() {
   world.dispose();
     
   }  
     
 }  


This is what i got


Can someone help preferable with pictures

This scaling thing got me frustrated

Thanks in advance

Edit:
The ball is supposed to be the size of basketball
which is 78 centimetes which is .78 meter but since box2d creates from the center i.e radius
.78/2 equals .39

Offline Tinhorn

Senior Member


Medals: 1
Projects: 3



« Reply #4 - Posted 2013-06-25 19:17:31 »

Should i think of box2d world as another world or as a  behind the scene world
Lets say I am using a .01 conversion rate from pixel to meter
so 1 meter = 100 pixels
Lets say my "Libgdx" world is 480 pixels by 320 pixels
Would that mean my "BOX2D" world is 4.8 meters by 3.2 meters

Lets say i have a 1 meter ball
Would that be a 100 pixels ball in my "Libgdx" world

would i initialize my Circeshape radius to .5
1  
circleShape.setRadius(.5f);

but my sprite size to be 100
1  
sprite.SetSize(100,100);



would i have to set my sprite's position to the circlebody's position but multiply it by a hundred;

1  
sprite.setPosition(circlebody.getPosition().x * 100, circlebody.getPosition().y * 100)


if that is correct, and i used the debug renderer .

wouldn't my box2d world be definitely smaller and not in the same position in the screen

Offline kutucuk

Senior Member


Medals: 5
Exp: 3 years



« Reply #5 - Posted 2013-06-25 19:28:47 »

It's best for you to experiment that, but you should either scale everything down to box (including position and size) or scale your Box2D objects up to the world.

Like you said, set up a debug renderer and experiment. I think you are in the exact same spot I was a while ago. Because I don't exactly understand your problem, I'll give you a way to understand how it works.
-Set up some box2d object around the screen. All can have different positions and sizes.
-Set up a debug renderer.
-Set up a mouse listener.
-Set a method to print the point of click to screen (Like, "you clicked 100.3:80.0")
-Print the location of your box2d objects.
-Click on an object and see how the object location and click location goes.

One thing; If you scale your sprites down, you don't need to scale any box2d objects.

And I think you should check this line about the wrong stuff:
1  
2  
sprite.setPosition(convertToPIXELS(circleBody.getPosition().x) - (sprite.getWidth() /2) , convertToPIXELS(circleBody.getPosition().y) - (sprite.getHeight()/2));
     

You should scale down the sprite.getWidth() too. If you don't scale, Box2D will assume 1 meter = 1 pixel.
The width and height of your sprite don't change if you scale it down. So, sprite.getWidth() will get the actual size of the sprite. Try this:
1  
2  
sprite.setPosition(convertToPIXELS(circleBody.getPosition().x) -convertToPIXELS(sprite.getWidth() /2) , convertToPIXELS(circleBody.getPosition().y) - convertToPIXELS(sprite.getHeight()/2));
     
Offline Tinhorn

Senior Member


Medals: 1
Projects: 3



« Reply #6 - Posted 2013-06-25 20:23:40 »

Thanks man ill check that out when i get home

But i was trying to say was if i had a scale of 32 pixels to 1 meter

and i drew a box of 1 meter
subsequently i drew a sprite of 32 pixels

why wouldn't the sprite bigger than the box when rendered because 32 is bigger than 1

Offline Phibedy

Senior Member


Medals: 8



« Reply #7 - Posted 2013-06-25 22:23:46 »

I wouldn't use pixel to meters value, use a camera instead.
There are some reasons why your bodies should be to big:
1. Big bodies are buggy
2. the velocity is limited at about 320 m/s

use this camera for box2d-stuff (2D): http://code.google.com/p/libgdx/wiki/OrthographicCamera

There are a lot of tutorials that telll you that you should use pixel to box2d-values, but there is no reason for doing it.
I am using realworld to box2d-values, so for example a car that is 3 meters long, is in box2d 0.5m. value:  6:1
Why you should use little bodies:
->your bodies are moving slowly
->you reduce the size of your world, everything is smaller, bodies are still moving slowly
-> you zoom in, bodies are moving fast.
So you if want fast moving bodies your box2d-world has to be "little"
Of course they aren't really moving faster, for examle:
Your screen is 3200 box2d-meters in width, your bullet is one meter
-> if the bullet reaches the max-speed it needs 10 seconds to cross the screen
--> you reduce the size of your world + zoom in (by 0.1)
--> The world looks still the same but, your screen is 320 box2d-meters and your bullet is 0.1m
---> the bullets seems to move faster because it's only needs 1 sec to cross the screen.

but they shouldn't be to small because of Tunneling (collision), think of body.setBullet(boolean)

good luck Smiley
Offline Tinhorn

Senior Member


Medals: 1
Projects: 3



« Reply #8 - Posted 2013-06-26 13:18:25 »

Figured it out

I followed the advice in the thread
and mostly my problem WAS when i scaled the box2d and i used the debug renderer.
The debug render was too small
So what i did was scale the projection matrix by the scaling factor i used;
and everything was fine

Thank everyone for their patience, a lot of you guys didn't understand my question but still try to help
You guys are the best

I learned a lot of things about box2d as well during this trial and error process
For example:
Box2d build around the center but Libgdx build from the lower left
So you have to compensate in the conversion

This is my new code
I'll commented the part that was relevant in my problem


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
package com.Fawaz.Tut;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.CircleShape;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;



 public class Box2d implements ApplicationListener, InputProcessor {
    OrthographicCamera camera;
    Sprite Circle;
    SpriteBatch batch;
    World world;
    Body circleBody;
    Box2DDebugRenderer renderer;
    FPSLogger logger;
    // Pixel per X and Y axis
   // The world is going to be 10 width 10 height
   private float PPuX;
    private float PPuY;
    int i = 0;
    private float WORLD_TO_BOX = .01f;
    private float BOX_TO_WORLD = 100f;
    Matrix4 debugMatrix;
    CircleShape circleShape;
   
   @Override
   public void create() {
      Circle = new Sprite(new Texture(Gdx.files.internal("data/Circle.png")));
      Circle.setBounds(4.5f, 8f, 1f, 1f);
      batch = new SpriteBatch();
     
      Gdx.input.setInputProcessor(this);
     
     
   }

   @Override
   public void resize(int width, int height) {
      PPuX = width / 10;
      PPuY = height / 10;
      world = new World(new Vector2(0, -9.8f), false);
      renderer = new Box2DDebugRenderer();
     
      logger = new FPSLogger();
      camera = new OrthographicCamera(width, height);
      debugMatrix=new Matrix4(camera.combined);
     

      while(i == 0){
         i++;
      Circle.setBounds(Circle.getX() * PPuX, Circle.getY() * PPuY, Circle.getWidth() * PPuX, Circle.getHeight() * PPuY);
      Circle.setOrigin(Circle.getWidth()/2, Circle.getHeight()/2);
      BodyDef circleDef = new BodyDef();
      circleDef.type = BodyType.DynamicBody;
      // To allign the Circle sprite with box 2d
     circleDef.position.set(convertToBox(Circle.getX() + Circle.getWidth()/2), convertToBox(Circle.getY() + Circle.getHeight()/2));
      circleBody = world.createBody(circleDef);
      //box2d builds around 0,0 you can see -X and -Y, this makes sure that you only see X,Y
     debugMatrix.translate(-camera.viewportWidth/2, -camera.viewportHeight/2, 0);
      //scale the debug matrix by the scaling so everything looks normal
     debugMatrix.scale(BOX_TO_WORLD, BOX_TO_WORLD, 0);
      circleShape = new CircleShape();
      circleShape.setRadius(convertToBox(Circle.getWidth()/2));
     
      FixtureDef circleFixture = new FixtureDef();
      circleFixture.shape = circleShape;
      circleFixture.density = 0.4f;
      circleFixture.friction = 0.2f;
      circleFixture.restitution = 1;
     
      circleBody.createFixture(circleFixture);
      circleBody.setUserData(Circle);
     
      BodyDef groundDef = new BodyDef();
      groundDef.position.set(convertToBox(camera.viewportWidth/2),0);
     
      Body groundBody = world.createBody(groundDef);
     
     
      PolygonShape groundBox = new PolygonShape();
     
      groundBox.setAsBox(convertToBox(camera.viewportWidth/2), 0);
      groundBody.createFixture(groundBox, 0);
      }
     
   
     
   }

   @Override
   public void render() {
      Gdx.gl.glClearColor(0, 0, 0, 1);
      Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
      Sprite sprite;
      sprite = (Sprite) circleBody.getUserData();
      // set position and width and height and makes sure it is in the center
     sprite.setBounds(convertToWorld(circleBody.getPosition().x)-sprite.getWidth()/2,  convertToWorld(circleBody.getPosition().y)-sprite.getHeight()/2, convertToWorld(circleShape.getRadius()*2), convertToWorld(circleShape.getRadius()*2));
      renderer.render(world, debugMatrix);
     

      System.out.println(circleBody.getPosition());
     
      world.step(1/45f, 6, 2);
     
      //logger.log();
     batch.begin();
      //Circle.draw(batch);
     sprite.draw(batch);
      batch.end();
   }

   @Override
   public void pause() {
     
     
   }

   @Override
   public void resume() {
     
     
   }

   @Override
   public void dispose() {
   //world.dispose();
     
   }  
    public float convertToBox(float x){
       return x * WORLD_TO_BOX;
    }
   
    public float convertToWorld(float x){
       return x * BOX_TO_WORLD;
    }

   @Override
   public boolean keyDown(int keycode) {
      // TODO Auto-generated method stub
     return false;
   }

   @Override
   public boolean keyUp(int keycode) {
      // TODO Auto-generated method stub
     return false;
   }

   @Override
   public boolean keyTyped(char character) {
      // TODO Auto-generated method stub
     return false;
   }

   @Override
   public boolean touchDown(int screenX, int screenY, int pointer, int button) {
      System.out.println(screenX+" " +screenY);
      return false;
   }

   @Override
   public boolean touchUp(int screenX, int screenY, int pointer, int button) {
      // TODO Auto-generated method stub
     return false;
   }

   @Override
   public boolean touchDragged(int screenX, int screenY, int pointer) {
      // TODO Auto-generated method stub
     return false;
   }

   @Override
   public boolean mouseMoved(int screenX, int screenY) {
      // TODO Auto-generated method stub
     return false;
   }

   @Override
   public boolean scrolled(int amount) {
      // TODO Auto-generated method stub
     return false;
   }
 }  


Thank you guys again

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (40 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!