Timeline for what makes render() and update() change frame 60 times every second in LibGDX
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 8, 2017 at 17:54 | vote | accept | chanu19 | ||
Feb 8, 2017 at 17:54 | vote | accept | chanu19 | ||
Feb 8, 2017 at 17:54 | |||||
Feb 8, 2017 at 10:36 | comment | added | chanu19 | Oh ok thank you. I see. Then can I ask you one final question? In my game, in the main class, I declared a SecondClass(that has its own render() method) using its constructor in the create() method. Then, I didn't have any render() method in the MainClass. When I did this, the render() in the SecondClass worked. However, when I created the render() method in the MainClass, the render() from the MainClass worked but not the render() method in the SecondClass. Does that mean that the project generator access the first render() it can see as the GameLoop? | |
Feb 8, 2017 at 10:14 | comment | added | ratchet freak | because the MyGame.render method gets called 60 times a second and it calls renderer.render(). libgdx has nothing to do with that. | |
Feb 8, 2017 at 10:11 | comment | added | chanu19 | Oh but the second part of my question was how the render() method work s as a gameloop in classes other than the main class. In my game, I created a method called Renderer that renders all the code from another method called Updater. In the render() method of the main class, MyGame, I wrote something like this: private void render() { renderer.render(); } Then the renderer.render code is called 60times per second just like the render() method in the main class | |
Feb 8, 2017 at 10:06 | comment | added | chanu19 | The project generator is the thing that turns the code into a game right? So according to you, the libgdx project generator looks for the methods (in this case the render() method) and make it into a gameloop by using some complex code hiding in the dark within the libgdx api. (Please correct me if I misunderstood this part) | |
Feb 8, 2017 at 9:00 | history | answered | ratchet freak | CC BY-SA 3.0 |