{"action":"closed","issue":{"url":"https://api.github.com/repos/GoranM/bdx/issues/867","repository_url":"https://api.github.com/repos/GoranM/bdx","labels_url":"https://api.github.com/repos/GoranM/bdx/issues/867/labels{/name}","comments_url":"https://api.github.com/repos/GoranM/bdx/issues/867/comments","events_url":"https://api.github.com/repos/GoranM/bdx/issues/867/events","html_url":"https://github.com/GoranM/bdx/issues/867","id":212630410,"number":867,"title":"2D Layering System?","user":{"login":"SolarLune","id":4733521,"avatar_url":"https://avatars1.githubusercontent.com/u/4733521?v=3","gravatar_id":"","url":"https://api.github.com/users/SolarLune","html_url":"https://github.com/SolarLune","followers_url":"https://api.github.com/users/SolarLune/followers","following_url":"https://api.github.com/users/SolarLune/following{/other_user}","gists_url":"https://api.github.com/users/SolarLune/gists{/gist_id}","starred_url":"https://api.github.com/users/SolarLune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SolarLune/subscriptions","organizations_url":"https://api.github.com/users/SolarLune/orgs","repos_url":"https://api.github.com/users/SolarLune/repos","events_url":"https://api.github.com/users/SolarLune/events{/privacy}","received_events_url":"https://api.github.com/users/SolarLune/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-08T03:49:15Z","updated_at":"2017-03-09T08:40:28Z","closed_at":"2017-03-09T08:40:28Z","body":"Hey, there. \r\n\r\nSo basically, I was thinking of maybe making a component that would basically function as a layering system for objects in 2D (mainly sidescrolling) games. The goal would be to have something light in code that would make it easy to consistently lock specific objects to specific depths. Ideally, this solution would also easily allow re-arranging those depths as the game grows and further needs are discovered. So, for example, as the game is created and a second Background layer is needed, it doesn't necessitate going through all already-created objects and tweaking their individual positions to fit the new needs.\r\n\r\nThe API would be relatively simple, I think - something like:\r\n\r\n```java\r\n\r\n// System.java\r\n\r\npublic void init() {\r\n    LayerSystem ls = new LayerSystem(\"Y\");  // Create the system with the name of the depth axis\r\n    ls.layers.add(\"Main\", 0);\r\n    ls.layers.add(\"Background\", 100);\r\n    ls.layers.add(\"Foreground\", -100);\r\n    bdx.components.add(ls);\r\n}\r\n\r\n// Player.java\r\n\r\npublic void init() {\r\n    LayerSystem ls = (LayerSystem) bdx.components.get(\"LayerSystem\");\r\n    ls.add(this, \"Main\");\r\n}\r\n\r\n// Enemy.java\r\n\r\npublic void init() {\r\n    LayerSystem ls = (LayerSystem) bdx.components.get(\"LayerSystem\");\r\n    ls.add(this, \"Main\");\r\n}\r\n\r\n// FlameParticle.java\r\n\r\npublic void init() {\r\n    LayerSystem ls = (LayerSystem) bdx.components.get(\"LayerSystem\");\r\n    ls.add(this, \"Foreground\");\r\n}\r\n\r\n```\r\n\r\nNot sure if this would be necessary enough for inclusion as a component, though, which is why I wanted to get some feedback. Thanks."}}
{"actor":{"display_login":"SolarLune"}}