Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2
1  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Proper Way to Handle GUI Input. on: 2014-07-09 16:27:25
Nevermind I had it backwards. I've been doing event-driven. But I loop through all events once an update. I'm doing something like this
1  
2  
3  
while(Keyboard.next()) {
    forward to listeners
}
2  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Proper Way to Handle GUI Input. on: 2014-07-09 16:20:34
Can you link or show me a quick example? The only 2 ways that I know of handling events is every update to loop through all the handlers in my UI in zorder and break the loop on a hit. Or using something like Keyboard.isKeyDown(). But how would I use the latter for, say a textbox without having to write out all possible keys?
3  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Proper Way to Handle GUI Input. on: 2014-07-09 16:12:58
So polling is the proper way?
4  Game Development / Newbie & Debugging Questions / [LWJGL] Proper Way to Handle GUI Input. on: 2014-07-09 16:04:06
I've been working on a basic all-in-one 2D game library using LWJGL.
 
The UI that I created works fine just sometimes events are lost, or something.

I am currently polling the input for the UI and if a UI object returns true it breaks the loop through in my listener.

Is polling the best way to do this?
How else can I do this?

Lets make this a discussion!
5  Game Development / Newbie & Debugging Questions / Re: layers-Libgdx on: 2013-12-22 04:42:25
You can set a z-index and use a comparator.
 something like so:
1  
2  
3  
4  
5  
6  
7  
8  
Comparator<Integer> comp = new Comparator<Integer>(){
    @Override
    public int compare(int o1, int o2){
        return new Integer(o1.x).compareTo(o2.x);
    }
};

Collections.sort(list, comp);
6  Game Development / Newbie & Debugging Questions / Re: Making A Slider Component Problem on: 2013-12-21 18:20:12
Back when I used Slick2d and needed a simple ui I used this: https://code.google.com/p/slick-sui/ its clean(for the most part) and easy to edit to your liking.
7  Game Development / Newbie & Debugging Questions / Re: glScissor() does nothing. on: 2013-12-21 17:53:46
Wow, nevermind I just got it. You have to flush before disabling scissor_test
8  Game Development / Newbie & Debugging Questions / glScissor() does nothing. on: 2013-12-21 17:52:51
I started working on a library for my game based off of mattdesl's wiki, and I can't get glScissor to work.

As the title states this code does nothing for me.

1  
2  
3  
4  
        glScissor(100, 100, 100, 100);
        glEnable(GL_SCISSOR_TEST);
        render to spritebatch
        glDisable(GL_SCISSOR_TEST);
9  Game Development / Newbie & Debugging Questions / Re: Printing whole exception. on: 2013-12-02 14:31:23
Have you tried e.printstacktrace ?
10  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D Multitextured Terrain on: 2013-10-14 07:34:21
Will do. And I have progressed a WHOLE lot now. I will be working on water and world objects soon. My problem before was just the shared vertices, it wouldn't let me UVMap effectively.
11  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D Multitextured Terrain on: 2013-10-13 19:11:17
Thanks! Terrain patch is exactly what I was looking for in an example. It cleared up what I didn't understand.
12  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D Multitextured Terrain on: 2013-10-12 02:04:09
Yes, I knew that. That's why I didn't know how a textureatlas helps me.
13  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D Multitextured Terrain on: 2013-10-11 21:10:18
I know what a textureatlas is.

I just don't see how a TextureAtlas can draw on specified vertices of my mesh.
14  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D Multitextured Terrain on: 2013-10-11 19:18:59
Thanks, that answer clears a lot. And yeah, if you would like to share I would like to take a look.

Is the effect the one I spoke of?

With a mesh like that UV mapping certain corners of my mesh differently for tiles wouldn't have to be done. Since each set of triangles are symmetrical.
15  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D Multitextured Terrain on: 2013-10-11 03:33:06
I'm using LibGDX's Mesh class with verticeattribute for texcoords. And simply using mesh.render() with shaders applied. I have it working with 1 texture but since shaders bind using texCoords and the triangles touch texcoords are shared for example its not what I want: 

16  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D Multitextured Terrain on: 2013-10-11 02:59:12
Well I didn't mean to insult.

Just those answers aren't answering anything.

Its a 3D mesh. I want to texture it like a tile based game.

However, Its 3D.

I want to be able to draw a texture between two triangles that are forming a square.

A tile-based 3D map. Like in the video.
17  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D Multitextured Terrain on: 2013-10-11 02:29:57
Are you guys just trying to get posts? Seriously those comments mean nothing. How would I use a TextureAtlas, explain.
18  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D GL20 Wireframe on: 2013-10-10 06:20:42
I've been toying with meshes and shaders to make tile based terrain textures. However, I cannot figure out how to draw textures between certain vertices.

I've even though about using decals, but I held back because that would be sloppy.

I've been at it for days.
19  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D GL20 Wireframe on: 2013-10-09 22:57:35
Yes I know the difference. And I just took a look at mesh.java in the github.

I don't see how it draws the vertex arrays since none of the args are vertexes, I think I'm missing something.


can I get an example of how to use glDrawArrays?


this is what mesh.java looks like

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  
public void render (ShaderProgram shader, int primitiveType, int offset, int count, boolean autoBind) {
      if (!Gdx.graphics.isGL20Available()) throw new IllegalStateException("can't use this render method with OpenGL ES 1.x");
      if (count == 0) return;

      if (autoBind) bind(shader);

      if (isVertexArray) {
         if (indices.getNumIndices() > 0) {
            ShortBuffer buffer = indices.getBuffer();
            int oldPosition = buffer.position();
            int oldLimit = buffer.limit();
            buffer.position(offset);
            buffer.limit(offset + count);
            Gdx.gl20.glDrawElements(primitiveType, count, GL10.GL_UNSIGNED_SHORT, buffer);
            buffer.position(oldPosition);
            buffer.limit(oldLimit);
         } else {
            Gdx.gl20.glDrawArrays(primitiveType, offset, count);
         }
      } else {
         if (indices.getNumIndices() > 0)
            Gdx.gl20.glDrawElements(primitiveType, count, GL10.GL_UNSIGNED_SHORT, offset * 2);
         else
            Gdx.gl20.glDrawArrays(primitiveType, offset, count);
      }

      if (autoBind) unbind(shader);
   }
20  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D GL20 Wireframe on: 2013-10-09 22:31:08
Thanks that was helpful. So to answer a question that I had before that was never answered.

Can I use glDrawArrys and bind textures to make it a tile based 3D terrain?
21  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D GL20 Wireframe on: 2013-10-09 22:24:45
Is glDrawArrays efficient? More than mesh.render?

If so that would make some things a lot better for me.
22  Game Development / Newbie & Debugging Questions / LibGDX 3D GL20 Wireframe on: 2013-10-09 21:55:53
How do i render mesh wireframe in GL20 in GL10 you use glPolygonMode(GL20.GL_FRONT_AND_BACK, GL20..GL_LINE);

however, glPolygonMode doesn't exist in GL20
23  Game Development / Newbie & Debugging Questions / Re: 3D Networking trials. on: 2013-10-09 06:03:38
Oh, I had the same issue.

Create a movement class that keeps track of each movement packet received.

Every time the game updates use delta to calculate how far the player should move.

So say you receive a left movement packet > create a movement instance set it in the players instance

> gameloop checks if players have queued movement

> movement updates (position.x -= delta * ( u * v ))     meaning: u = speed and v = factor to make u*v = pixels per seconds wanted.

> if movement reaches pixels wanted per packet null it.

> game loop checks for movements if the movement is now null there is no movement.

That worked wonders for me.
24  Game Development / Newbie & Debugging Questions / Re: LibGDX 3D Multitextured Terrain on: 2013-10-09 02:57:42
How will a textureatlas texturize my mesh like tiles
25  Game Development / Newbie & Debugging Questions / Re: 3D Networking trials. on: 2013-10-09 00:48:56
Games like this shoudl be like so:

You connect to server > server sends other player's positions to you and sends your position to others players.

when a client moves send move to server > server updates client's position server side and sends move to others.

that's how I do it for tile based movement.
26  Game Development / Newbie & Debugging Questions / LibGDX 3D Multitextured Terrain on: 2013-10-09 00:33:04
So I have researched a whole lot but I cannot find out how to do it.

I know it is possible through shaders but I haven't been able to find a tut on how to do it with more than 2 textures.

The result I'm looking for is this: http://www.youtube.com/watch?v=J-FFLSV1mKE

I need help on figuring out how to draw a tile on a 3D triangle mesh grid, almost like 2D game maps are made. Just 3D.


So I need help applying textures to range of squares(2 adjacent triangles)

I have this so far  THE GUI IS A WIP:


27  Game Development / Newbie & Debugging Questions / Re: LibGDX TextureAtlas - Again on: 2013-08-28 21:56:55
Davedes that is exactly what I was looking for!
28  Game Development / Newbie & Debugging Questions / Re: LibGDX TextureAtlas - Again on: 2013-08-27 17:54:33
Nvm, I just decided to create a quick program that just recompiles my dat files and merges the pngs based on their group labels.
29  Game Development / Newbie & Debugging Questions / Re: LibGDX TextureAtlas - Again on: 2013-08-27 17:52:21
I don't mean the LibGDX texturepacker. I mean as I load my textures I would like to merge them with textures that I have labeled part of a group. Because as I progress in my game I don't want to have to redo all the textures. I just label them part of a group in my game files and when the game laods it I want it merged with another texture loaded of the group. I have been using TextureAtlas.addRegion for this, but it does not reduce texture binds, as I now know.
30  Game Development / Newbie & Debugging Questions / Re: LibGDX TextureAtlas - Again on: 2013-08-27 17:22:18
I understand batching and binds. I just was not sure if TextureAtlas created merged textures. Thanks. TextureAtlas has no use for me then. Is there a way to merge textures, through code?
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

pw (14 views)
2014-07-24 01:59:36

Riven (14 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!