{"action":"created","issue":{"url":"https://api.github.com/repos/nitlang/nit/issues/2477","repository_url":"https://api.github.com/repos/nitlang/nit","labels_url":"https://api.github.com/repos/nitlang/nit/issues/2477/labels{/name}","comments_url":"https://api.github.com/repos/nitlang/nit/issues/2477/comments","events_url":"https://api.github.com/repos/nitlang/nit/issues/2477/events","html_url":"https://github.com/nitlang/nit/pull/2477","id":234059427,"number":2477,"title":"gamnit: dynamic window resize","user":{"login":"xymus","id":208057,"avatar_url":"https://avatars3.githubusercontent.com/u/208057?v=3","gravatar_id":"","url":"https://api.github.com/users/xymus","html_url":"https://github.com/xymus","followers_url":"https://api.github.com/users/xymus/followers","following_url":"https://api.github.com/users/xymus/following{/other_user}","gists_url":"https://api.github.com/users/xymus/gists{/gist_id}","starred_url":"https://api.github.com/users/xymus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xymus/subscriptions","organizations_url":"https://api.github.com/users/xymus/orgs","repos_url":"https://api.github.com/users/xymus/repos","events_url":"https://api.github.com/users/xymus/events{/privacy}","received_events_url":"https://api.github.com/users/xymus/received_events","type":"User","site_admin":false},"labels":[{"id":81916087,"url":"https://api.github.com/repos/nitlang/nit/labels/need_review","name":"need_review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-07T00:25:06Z","updated_at":"2017-06-07T20:37:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nitlang/nit/pulls/2477","html_url":"https://github.com/nitlang/nit/pull/2477","diff_url":"https://github.com/nitlang/nit/pull/2477.diff","patch_url":"https://github.com/nitlang/nit/pull/2477.patch"},"body":"Enable dynamic window resizing on desktop computers. It follows the current behavior to preserve the virtual height of 1080 units while adapting the width to respect the window aspect ratio. This is the foolproof behavior, but clients can redef `on_resize` to configure the display as needed, or disable window resizing by setting a custom `GamnitDisplay::sdl_window_flags`.\r\n\r\nAs support, move `IPoint3d::offset` out of `gamnit` to `geometry` so it can be used by game logic (not just UI logic). And rework sprite positions derived from a camera anchor (such as `ui_camera.center` or `ui_camera.top_left`) to update them when the display is resized.\r\n\r\nIf needed, we could add a service to preserve the aspect ratio to the desired value. However, since mobile platforms are first class targets, gamnit games should support different resolutions. So have a range of accepted aspect ratios could be a solution to avoid unexpected ratios.\r\n\r\n![screenshot from 2017-06-06 20 06 23](https://user-images.githubusercontent.com/208057/26857006-a295d456-4af5-11e7-9d47-1321319b5887.png)\r\n![screenshot from 2017-06-06 20 06 32](https://user-images.githubusercontent.com/208057/26857008-a587c034-4af5-11e7-9816-358e8999a239.png)\r\n![screenshot from 2017-06-06 20 06 37](https://user-images.githubusercontent.com/208057/26857010-a8c33e9a-4af5-11e7-9c61-3117a68f51ef.png)\r\n![screenshot from 2017-06-06 20 06 40](https://user-images.githubusercontent.com/208057/26857016-aae02224-4af5-11e7-84ff-07f092f0289b.png)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/nitlang/nit/issues/comments/306917148","html_url":"https://github.com/nitlang/nit/pull/2477#issuecomment-306917148","issue_url":"https://api.github.com/repos/nitlang/nit/issues/2477","id":306917148,"user":{"login":"privat","id":135828,"avatar_url":"https://avatars2.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"created_at":"2017-06-07T20:37:01Z","updated_at":"2017-06-07T20:37:01Z","body":"Toaster : test this please"}}
{"actor":{"display_login":"privat"}}