Any tips on organizing a scene graph via the ini file? I'd like to organize my scene like this:
Scene
+-Tiles
+-Actors
+-Camera
Creating objects for different tiles/actors is straightforward. But the camera, I have questions about:
- How does one simultaneously connect the camera to both the viewport system and the object system? The coordinate for the camera should be set after tiles have been created, so as to center on them.
Comments
You could almost do the camera part from config. The only missing part is being able to link the camera to a parenting object.
If there were commands for the camera module, that'd have done the trick, but for now you'll need to write some code to set the camera's parent. Something like:
In config:
In code:
You can now handle the Camera via the CameraObject, including adding FXs (shakes, moves, scales(ie. 1/zoom), ...).
Yesterday I added a bunch of Camera.* commands, so the all-ini solution should be working now.
My UI code, on the C++ side, is only a generic 15 lines that track hower on/off, click/release status and simply add the matching tracks to the picked object if found in config.
The whole UI logic being done in config in the tracks.
That also allowed us to have the artist/designer do the whole UI/menus on their own without waiting for me to write any piece of dedicated code.
I just did a quick test locally and it worked for me. One thing to check: make sure your camera is created before the object that will be its parent, basically having the viewport created before the scene should do the trick.