| 3 | namespace obe::Config::Templates |
| 4 | { |
| 5 | vili::parser::state getGameObjectTemplates() |
| 6 | { |
| 7 | vili::parser::state state; |
| 8 | |
| 9 | // Units |
| 10 | state.push_template("SceneUnits", "SceneUnits"); |
| 11 | state.push_template("ScenePixels", "ScenePixels"); |
| 12 | state.push_template("ViewUnits", "ViewUnits"); |
| 13 | state.push_template("ViewPercentage", "ViewPercentage"); |
| 14 | state.push_template("ViewPixels", "ViewPixels"); |
| 15 | |
| 16 | // Referentials |
| 17 | state.push_template("TopLeft", "TopLeft"); |
| 18 | state.push_template("TopLeft", "Top"); |
| 19 | state.push_template("TopRight", "TopRight"); |
| 20 | state.push_template("Left", "Left"); |
| 21 | state.push_template("Center", "Center"); |
| 22 | state.push_template("Right", "Right"); |
| 23 | state.push_template("BottomLeft", "BottomLeft"); |
| 24 | state.push_template("Bottom", "Bottom"); |
| 25 | state.push_template("BottomRight", "BottomRight"); |
| 26 | |
| 27 | // Sprite |
| 28 | vili::node rect = vili::object { { "x", 0.f }, { "y", 0.f }, { "width", 0.f }, |
| 29 | { "height", 0.f }, { "unit", "SceneUnits" } }; |
| 30 | state.push_template("Rect", rect); |
| 31 | vili::node positionTransform |
| 32 | = vili::object { { "x", "Position" }, { "y", "Position" } }; |
| 33 | vili::node cameraTransform |
| 34 | = vili::object { { "x", "Camera" }, { "y", "Camera" } }; |
| 35 | vili::node parallaxTransform |
| 36 | = vili::object { { "x", "Parallax" }, { "y", "Parallax" } }; |
| 37 | |
| 38 | state.push_template("PositionTransform", positionTransform); |
| 39 | state.push_template("CameraTransform", cameraTransform); |
| 40 | state.push_template("ParallaxTransform", parallaxTransform); |
| 41 | |
| 42 | return state; |
| 43 | } |
| 44 | } |
no test coverage detected