{"action":"created","issue":{"url":"https://api.github.com/repos/pixijs/pixi.js/issues/3048","repository_url":"https://api.github.com/repos/pixijs/pixi.js","labels_url":"https://api.github.com/repos/pixijs/pixi.js/issues/3048/labels{/name}","comments_url":"https://api.github.com/repos/pixijs/pixi.js/issues/3048/comments","events_url":"https://api.github.com/repos/pixijs/pixi.js/issues/3048/events","html_url":"https://github.com/pixijs/pixi.js/pull/3048","id":180534893,"number":3048,"title":"Giant tilingSprite refactoring.","user":{"login":"ivanpopelyshev","id":695831,"avatar_url":"https://avatars.githubusercontent.com/u/695831?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanpopelyshev","html_url":"https://github.com/ivanpopelyshev","followers_url":"https://api.github.com/users/ivanpopelyshev/followers","following_url":"https://api.github.com/users/ivanpopelyshev/following{/other_user}","gists_url":"https://api.github.com/users/ivanpopelyshev/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanpopelyshev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanpopelyshev/subscriptions","organizations_url":"https://api.github.com/users/ivanpopelyshev/orgs","repos_url":"https://api.github.com/users/ivanpopelyshev/repos","events_url":"https://api.github.com/users/ivanpopelyshev/events{/privacy}","received_events_url":"https://api.github.com/users/ivanpopelyshev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pixijs/pixi.js/labels/Domain:%20API","name":"Domain: API","color":"006b75"},{"url":"https://api.github.com/repos/pixijs/pixi.js/labels/Plugin:%20Tiling%20Sprite","name":"Plugin: Tiling Sprite","color":"207de5"},{"url":"https://api.github.com/repos/pixijs/pixi.js/labels/PR:%20Needs%20Review","name":"PR: Needs Review","color":"e99695"},{"url":"https://api.github.com/repos/pixijs/pixi.js/labels/Renderer:%20WebGL","name":"Renderer: WebGL","color":"bfe5bf"},{"url":"https://api.github.com/repos/pixijs/pixi.js/labels/Type:%20Enhancement","name":"Type: Enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/pixijs/pixi.js/labels/Type:%20Refactor","name":"Type: Refactor","color":"35AE58"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-02T20:57:19Z","updated_at":"2016-10-02T21:02:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pixijs/pixi.js/pulls/3048","html_url":"https://github.com/pixijs/pixi.js/pull/3048","diff_url":"https://github.com/pixijs/pixi.js/pull/3048.diff","patch_url":"https://github.com/pixijs/pixi.js/pull/3048.patch"},"body":"1. Rotated and trimmed textures are allowed\r\n2. \"full\" textures use simple shader if they have WRAP_MODE.REPEAT\r\n3. WRAP_MODE.REPEAT is forced if that texture uploads in TilingSprite first time\r\n4. TilingSprite now has tileTransform which applies to the \"zero tile\" like if its been a child\r\n\r\nThis is visual test, run in examples:\r\n\r\n```js\r\n\r\nvar renderer = PIXI.autoDetectRenderer(800, 600);\r\ndocument.body.appendChild(renderer.view);\r\n\r\n// create the root of the scene graph\r\nvar stage = new PIXI.Container();\r\n\r\n// create a texture from an image path\r\nvar texture = PIXI.Texture.fromImage('_assets/p2.jpeg');\r\n\r\n/* create a tiling sprite ...\r\n * requires a texture, a width and a height\r\n * in WebGL the image size should preferably be a power of two\r\n */\r\nvar tilingSprite = new PIXI.extras.TilingSprite(texture, renderer.width, renderer.height);\r\nstage.addChild(tilingSprite);\r\n\r\ntilingSprite.tileTransform.pivot.set(400, 300);\r\n\r\nvar count = 0;\r\nvar cnt = 0;\r\n\r\nanimate();\r\n\r\nfunction animate() {\r\n    cnt = (cnt+1)%40;\r\n    if (texture.valid) {\r\n        var offset = Math.min(cnt, 40-cnt);\r\n        texture.orig = new PIXI.Rectangle(0, 0, 128, 128);\r\n        texture.frame = new PIXI.Rectangle(offset, offset, 128-2*offset, 128-2*offset);\r\n        texture.trim = new PIXI.Rectangle(offset, offset, 128-2*offset, 128-2*offset);\r\n        set = true;\r\n    }\r\n\r\n    count += 0.001;\r\n    tilingSprite.tileTransform.rotation = count;\r\n\r\n    tilingSprite.tileScale.x = 2 + Math.sin(count);\r\n    tilingSprite.tileScale.y = 2 + Math.cos(count);\r\n\r\n    tilingSprite.tilePosition.x += 1;\r\n    tilingSprite.tilePosition.y += 1;\r\n\r\n    // render the root container\r\n    renderer.render(stage);\r\n\r\n    requestAnimationFrame(animate);\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/pixijs/pixi.js/issues/comments/250995755","html_url":"https://github.com/pixijs/pixi.js/pull/3048#issuecomment-250995755","issue_url":"https://api.github.com/repos/pixijs/pixi.js/issues/3048","id":250995755,"user":{"login":"kaansoral","id":170243,"avatar_url":"https://avatars.githubusercontent.com/u/170243?v=3","gravatar_id":"","url":"https://api.github.com/users/kaansoral","html_url":"https://github.com/kaansoral","followers_url":"https://api.github.com/users/kaansoral/followers","following_url":"https://api.github.com/users/kaansoral/following{/other_user}","gists_url":"https://api.github.com/users/kaansoral/gists{/gist_id}","starred_url":"https://api.github.com/users/kaansoral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaansoral/subscriptions","organizations_url":"https://api.github.com/users/kaansoral/orgs","repos_url":"https://api.github.com/users/kaansoral/repos","events_url":"https://api.github.com/users/kaansoral/events{/privacy}","received_events_url":"https://api.github.com/users/kaansoral/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T21:02:06Z","updated_at":"2016-10-02T21:02:06Z","body":"I can't wait to test this, does it improve the quality too, which everyone complains about?"}}
{"actor":{"display_login":"kaansoral"}}