{"action":"created","issue":{"url":"https://api.github.com/repos/libktx/ktx/issues/157","repository_url":"https://api.github.com/repos/libktx/ktx","labels_url":"https://api.github.com/repos/libktx/ktx/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/libktx/ktx/issues/157/comments","events_url":"https://api.github.com/repos/libktx/ktx/issues/157/events","html_url":"https://github.com/libktx/ktx/issues/157","id":362111711,"node_id":"MDU6SXNzdWUzNjIxMTE3MTE=","number":157,"title":"Problem with inline function Engine.add in ktx-ashley","user":{"login":"Divelix","id":25386431,"node_id":"MDQ6VXNlcjI1Mzg2NDMx","avatar_url":"https://avatars0.githubusercontent.com/u/25386431?v=4","gravatar_id":"","url":"https://api.github.com/users/Divelix","html_url":"https://github.com/Divelix","followers_url":"https://api.github.com/users/Divelix/followers","following_url":"https://api.github.com/users/Divelix/following{/other_user}","gists_url":"https://api.github.com/users/Divelix/gists{/gist_id}","starred_url":"https://api.github.com/users/Divelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Divelix/subscriptions","organizations_url":"https://api.github.com/users/Divelix/orgs","repos_url":"https://api.github.com/users/Divelix/repos","events_url":"https://api.github.com/users/Divelix/events{/privacy}","received_events_url":"https://api.github.com/users/Divelix/received_events","type":"User","site_admin":false},"labels":[{"id":620612511,"node_id":"MDU6TGFiZWw2MjA2MTI1MTE=","url":"https://api.github.com/repos/libktx/ktx/labels/ashley","name":"ashley","color":"ffffff","default":false},{"id":401695813,"node_id":"MDU6TGFiZWw0MDE2OTU4MTM=","url":"https://api.github.com/repos/libktx/ktx/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/libktx/ktx/milestones/8","html_url":"https://github.com/libktx/ktx/milestone/8","labels_url":"https://api.github.com/repos/libktx/ktx/milestones/8/labels","id":2945105,"node_id":"MDk6TWlsZXN0b25lMjk0NTEwNQ==","number":8,"title":"1.9.8","description":"Features planned for KTX built on LibGDX 1.9.8.","creator":{"login":"czyzby","id":11707612,"node_id":"MDQ6VXNlcjExNzA3NjEy","avatar_url":"https://avatars0.githubusercontent.com/u/11707612?v=4","gravatar_id":"","url":"https://api.github.com/users/czyzby","html_url":"https://github.com/czyzby","followers_url":"https://api.github.com/users/czyzby/followers","following_url":"https://api.github.com/users/czyzby/following{/other_user}","gists_url":"https://api.github.com/users/czyzby/gists{/gist_id}","starred_url":"https://api.github.com/users/czyzby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czyzby/subscriptions","organizations_url":"https://api.github.com/users/czyzby/orgs","repos_url":"https://api.github.com/users/czyzby/repos","events_url":"https://api.github.com/users/czyzby/events{/privacy}","received_events_url":"https://api.github.com/users/czyzby/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":28,"state":"open","created_at":"2017-11-28T23:08:34Z","updated_at":"2018-09-20T10:49:16Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2018-09-20T10:01:47Z","updated_at":"2018-09-20T11:50:42Z","closed_at":null,"author_association":"NONE","body":"I just started to exlore ktx, and stuck on Ashley module. When I add Entity to an Engine \"traditional way\" everything works fine:\r\n```kotlin\r\n        val entity = Entity()\r\n        val dc = DrawableComponent(Sprite(Texture(\"image1.png\")))\r\n        val tc = TransformComponent(Vector2(50f, 50f))\r\n        entity.add(dc)\r\n        entity.add(tc)\r\n        engine.addEntity(entity)\r\n```\r\nBut when I try to do the same in \"ktx way\" compiler throws an error:\r\n```kotlin\r\n    engine.add {\r\n        entity {\r\n            with<DrawableComponent> {\r\n                sprite = Sprite(Texture(\"image1.png\"))\r\n            }\r\n            with<TransformComponent> {\r\n                position.set(50f, 50f)\r\n            }\r\n        }\r\n    }\r\n```\r\nHere is the error:\r\n\r\n> Exception in thread \"LWJGL Application\" java.lang.IllegalStateException: createComponent(T::class.java).apply(configure) must not be null\r\n\r\nP.S. it complains on `engine.add` line"},"comment":{"url":"https://api.github.com/repos/libktx/ktx/issues/comments/423154472","html_url":"https://github.com/libktx/ktx/issues/157#issuecomment-423154472","issue_url":"https://api.github.com/repos/libktx/ktx/issues/157","id":423154472,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzE1NDQ3Mg==","user":{"login":"Divelix","id":25386431,"node_id":"MDQ6VXNlcjI1Mzg2NDMx","avatar_url":"https://avatars0.githubusercontent.com/u/25386431?v=4","gravatar_id":"","url":"https://api.github.com/users/Divelix","html_url":"https://github.com/Divelix","followers_url":"https://api.github.com/users/Divelix/followers","following_url":"https://api.github.com/users/Divelix/following{/other_user}","gists_url":"https://api.github.com/users/Divelix/gists{/gist_id}","starred_url":"https://api.github.com/users/Divelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Divelix/subscriptions","organizations_url":"https://api.github.com/users/Divelix/orgs","repos_url":"https://api.github.com/users/Divelix/repos","events_url":"https://api.github.com/users/Divelix/events{/privacy}","received_events_url":"https://api.github.com/users/Divelix/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T11:50:42Z","updated_at":"2018-09-20T11:50:42Z","author_association":"NONE","body":"Oh, ok, I just added default values for both components and it works fine now:\r\n```kotlin\r\nclass DrawableComponent(var sprite: Sprite = Sprite(Texture(\"arhat.png\"))): Component \r\nclass TransformComponent(val position: Vector2 = Vector2()): Component\r\n```\r\nIt was really not obvious thing for me, thank you."}}
{"actor":{"display_login":"Divelix"}}