Prodoxx Posted August 16, 2014 Share Posted August 16, 2014 Hey. So bascially, I was wondering if there is a way to create a camara object that is tied to only a certain part of the game screen.Then controll dat part of the screen. Like a rectangle. I know there is a way to do this but ... I want to add texts and sprites in that rectangle that can be browsed around using the camara. Bascially, I want to emulate a kind of scrolling through items in the game's UI. The type of scrolling you do on mobile.I want to show a bunch of texts vertically but its a lot so it goes off the game's height therefore i wanted to do a kind of scrolling for it to still contain it within the game screen. Is this possible? If so, any help please? Link to comment Share on other sites More sharing options...
lewster32 Posted August 16, 2014 Share Posted August 16, 2014 Rather than using a camera for this (which you can't do in the way you describe) the usual way this is done is to move the objects themselves. This post has a visual which kinda explains this better: http://www.html5gamedevs.com/topic/8094-how-to-tween-an-image-vertically-with-a-smooth-infinite-tween/?p=48498 The way this is done in browser frameworks is that only as many buttons/items are created as is needed to fill the screen with some padding. Then when the user scrolls or drags, all of the items move in the direction the user moved their finger, and the items that fly off the back end of the screen are instantly moved to the front again, and their contents is changed to reflect the next item in the data set. If you're not creating loads of items, and just have a few going off the bottom of the screen, you could implement this sort of effect without the recycling, and just have all of the items move up or down. Link to comment Share on other sites More sharing options...
Recommended Posts