Laumark Posted March 22, 2016 Share Posted March 22, 2016 Hey guys. For my mobile game I need to make part of the screen scrollable (The marked space in the picture). Does anyone have an idea on how to do that? Thanks in advance! scrollable Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 22, 2016 Share Posted March 22, 2016 Cant look at it. Can you upload it somewhere? Quote Link to comment Share on other sites More sharing options...
Laumark Posted March 22, 2016 Author Share Posted March 22, 2016 Ah, of course! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 22, 2016 Share Posted March 22, 2016 var myContainer = new PIXI.Container(); //... //do that once myContainer.filterArea = new PIXI.Rectangle(myContainer.position.x, myContainer.position.y, containterWidth, containerHeight); // Instead of mask I use filter. There's no "noop" filter, but fxaa is best choice :) var fxaaFilter = new PIXI.FXAAFilter(); myContainer.filters = [fxaaFilter]; //that's how you scroll it. //better to cache "myContainer.height" after you add all elements there myContainer.pivot.y = Math.max(0, Math.min(scrollY, myContainer.height - filter)); Something like that. Also, there is a problem with InteractinoManager, it does not take into account that trick, so it'll be possible to click on elements that were scrolled out of bounds. BUT if you make top and bottom views interactable and that they appear ON TOP (after) that thing, everything will be ok Quote Link to comment Share on other sites More sharing options...
renkinjutsushi Posted November 16, 2021 Share Posted November 16, 2021 @ivan.popelyshev, in your code you have mentioned "- filter", is this the height of the filter or there is a special property in the filter? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.