Tag Info

Hot answers tagged

4

I'm going to assume you're writing in Java as you're writing for Android, but if you're not you can look up methods in your language of choice to get the same sort of result. Since Java has no built in support for conditional compilation, there's some pretty easy things you can do here; sometimes the low-tech solution is the best one. Deploy a different app ...


3

I'd go for a second shader that accepts two textures and does the desaturation. Performance loss will be minimal. uniform sampler2D tex; uniform sampler2D texA; void main() { vec4 texelColor = texture2D(tex, gl_TexCoord[0].xy); vec4 maskColor = texture2D(texA, gl_TexCoord[1].xy); vec4 desatColor = texelColor * vec4(0.3, 0.59, 0.11, 1.0); // ...


3

There are two things crucial to get motion appearing smooth, the first is obviously that what you render needs to match the expected state at the time at which the frame is presented to the user, the second is that you need to present frames to the user at a relatively fixed interval. Presenting a frame at T+10ms, then another at T+30ms, then another at ...


2

What everyone has been telling you is correct. Never update your sprite's simulation position in your render logic. Think of it like this, your sprite has 2 positions; where the simulation says he is as of the last simulation update, and where the sprite is rendered. They are two completely different coordinates. The sprite is rendered at his ...


2

Fragment shaders operate with floats. This is an abstraction over the actual underlying hardware format (GLSL is a high-level language after all), so you shouldn't expect that to indicate that you've actually got a floating-point framebuffer. You'll always use vec4 in your fragment shader irrespective of if you have a 16-bit, 32-bit, 64-bit or 128-bit ...


1

Unfortunately, there is no magic: the only good way is to implement resolution independence yourself. While libgdx may be of some help, it's not going to solve your every problem. For my NoThree puzzle game (see profile for link), I drew my graphics in Inkscape and I exported several resolutions (144x144, 72x72, 48x48) for each texture (the font is also ...


1

For most games, most of the game logic should be done on the server to avoid cheating. However, in games like chess which are turn-based, have no information hiding and no randomness, this is something different. There is just no way to break the rules of chess without the other party being able to notice. This means that it is sufficient in this case to ...


1

Don,t do any thing just set the scale of the font and it will work for all type of device font.setScale( .9f,.9f);


1

You should use BitmapFont.drawWrapped. public BitmapFont.TextBounds drawWrapped(Batch batch, java.lang.CharSequence str, float x, float y, float wrapWidth) All you need to do is set the wrapWidth variable as ...



Only top voted, non community-wiki answers of a minimum length are eligible