@britzl How to use this library when there are a few states (menu and game screens for example) ?
for example, how to implement this lib in this your example of MenuAndGame
How should I proceed to add black bars to orthographic? Going for a specific look and don’t want to show more of the game screen than necessary when aspect ratio changes
You can either tinker in render script to adjust your window size (e.g. Subtract some value out of height and add offset on the bottom or use fixed values as you probably want), see GitHub - britzl/defold-orthographic: Orthographic camera functionality for the Defold game engine · GitHub, section manual integration and update function or… just add 2 simple box nodes in your gui that will cover those parts of the screen? Depending on what you need
I’ve released a new version of Orthographic. The new version supports a custom viewport per camera. This makes it very easy to setup and use multiple cameras, for instance when doing split-screen multiplayer. The new version introduced some breaking changes:
After adding dependency I can see camera.go in orthographic folder, but how add it to my game?
From tutorials I know that to add Game Object I have to use Factory. Do I need Factory in this case too?
For me as a guy who just passed all tutorial projects - add Game Object to your game is not clear instruction… Who can write step by step solution for me based on Walking astronaut tutorial project? Thanks!
P.S. I’ve added render as stated below, but I see black screen after building any of tutorial projects.
Open game.project and make sure to reference orthographic/render/orthographic.render in the Render field in the Bootstrap section.
This is about the 3rd time I have edited this question as I slowly understand more:-)
I misunderstood how local variables in Lua modules work. I thought different ‘requires’ in different files would result in different instances of a local variable, of the required file, but it does not seem to be the case! Paradigm shift for me!
So my question reduces to:
Are there any tutorials on the use of the Orthographic camera?
I now am getting stuff to work but it would be good to see more examples of usage.
When running the master, if (All Features,Deadzone,bounds) is selected then after a few mouse clicks the player vanishes and does not return, why does this occur? Also on mouse click the camera shakes, as expected, and the player vanishes for about a second; why does the player vanish & is there a fix? The browser example linked on the github page is not the same as the git hub master version, it does not have these problems.
I’m trying to get your orthographic camera working, but appear not to be getting it right. I’ve added and fetched the library and have camera.go. in my game. But then can’t get the camera to follow the player.
I’ve made some updates to Defold Orthographic (in case someone is still using it). The new version uses an actual camera component under the hood, and makes use of recent Defold additions such as screen to world and world to screen conversion functions. The camera position is updated in late_update to avoid jitter and one frame follow delay. Some functions which no longer make sense have been deprecated. I’ve also added an option to follow a center point between multiple game objects, and I’ve fixed some bugs: