Horizontal Camera Scrolling within given range - camera

I want to create a mobile Game, with only horizontal Camera Movement.
Like a SideScroller without the Camera being attached to an Actor.
I want to let the User only move within the given Range.
I'm using only Blueprints.
Just to make it sure, I really don't want to know, anything about the implemented Camera of any Mobile Device.
I just want my Camera Actor (From Unreal Engine) to behave like a normal App, where you can Scroll horizontal just by "swiping" the finger over the Screen from left-to-right to archieve a movement to the left and swiping from right-to-left to archieve a movement to the right.
Information I need:
How can I move the Camera horizontal by mobile Touch? (similar to Scrolling a ListView/RecyclerView in Android)
How can I just let the Camera move horizontal within the Map or given Range?
(See Pic's with Grey Background)
Current Map:
Current Static Camera View (Shouldn't go any furhter to the left):
Example Camera View (Shouldn't go any furhter to the right):
Thanks in advance for any helpful advise.

For the scrolling boundaries you could work with a float variable and set its min/max value manually. That way it never extends over those min/max values.
Or you could use this node instead.
Also check out this video, might give you an idea on how to implement your swipe mechanic.

Related

Make text stick to top of screen, even when moving camera

I am learning Haxe Flixel. I have a text that I want to stick to the top of the screen. I couldn't find anything in the API. How can I make a textObject stick even when camera centered around player is moving?
Similarly. How can I set up lower bounds of the screen, to make camera not have the radius around my player, and have the lower bound at the bottom of the screen?
Use scrollFactor
object.scrollFactor.set(0, 0);
https://snippets.haxeflixel.com/camera/scrollfactor/

How to build below screen in titanium?

below i attached an app help guide screen. I am understanding how to build this screen.
If any body have idea please share here
View with semi transparent background color (backgroundColor:"rgba(0,0,0,0.5)";) and some images on top of it.
So, using images is bad. You'll need images for translations and if you do this as one image you'll need to ensure all devices are covered so your arrows point to the right element.
Minimise images == smaller app.
First thing you'll need to do is a create a blocker view -- so that's a view that will fill the screen and have a black background with opacity.
You can't apply that to the window as everything in it will be semi-transparent so:
Create a transparent Window that fills the screen.
Add to that window a view that fills the window and has opacity say 0.5 and black background
Add to the Window (not the view you just created) the other elements and button -- ideally, these should be individual graphics of the arrows, sized in such a way that you can position them based on the host element (the item they are pointing to / referring to). Use real text so you can handle translations / reduce file size.
So you'll need a way to associate each tip with a control they are anchored too, and that will ensure that regardless of the screen size, the tip will appear in the correct place.
First of all, always give a try before putting questions anywhere because it makes you learn things on your own for long time.
The easiest step for you to do this is to ask your designer to create a complete image just like that & you just have to show it on top.
If you have to show that image in different translations, then you can ask your designer to provide you required translations images.

Rotate a camera on its centre

What I want to do is to rotate a camera on it's centre while the camera position is steady. So as a result when the user clicks and moves the mouse he will get all the perspectives possible from that point of view.
I am using trackback controls so I have tried things like:
controls.target.set(camera.position.x,camera.position.y,camera.position.z);
but it does not give the wanted result. I am looking something like camera rotation on axes x,y,z while the camera position is the same.
How do I do it?
If you want to keep TrackballControls, set a very close target (set the camera position and the controls.target to very close coordinates, but different ones).
Otherwise use PointerLockControls

iOS horizontal swipe room selection

I am making an iOS app for remote controlling the lights in my house. I have a list of groups of bulbs (rooms) that can be turned on and off. My problem is selecting a room, I want it to be like this:
You can either press the arrows left or right to switch the room, or you can put your finger, where it says Living Room and swipe left or right to switch it.
Can someone give me a pointer as how to implement a swipe feature like that? I know there are gesture recognizers. I never used them, but I guess they won't automatically make the text I want to swipe follow my finger.
I guess it would be possible to use the gesture recognizer and manually move the text to get the swipe "feeling". It just seems to me like there should be an easier solution.
I've done something similar several times, and the most elementary way to approach it is to override the touches... methods on NSResponder. This will tell you when a user's finger touches the component, when it moves, and when they let go. From that, it's pretty easy to adjust the position of your UIView, do some custom rendering, or whatever else you need.
Another, higher-level, approach is to use a UIScrollView and implement it's delegate methods. Inside the scroll view are three elements which completely fill the viewport: the one you can see, and those to the left and right. You watch the delegate events for the user adjusting the position of the viewport and as they expose an element to the left or right, you can snap the viewport into place when they let go. Then, you adjust the three inner views to show the appropriate new content and reset the viewport to expose the middle element (which would then be showing the appropriate content).
There are undoubtedly many other approaches, but I've used both of these with good effect.
I solved it in the end by using a pangesturerecgonizer attached to the label. It's pretty straight forward, I just didn't know pan is supposed to mean something like drag and drop, I thought pan would be something completely different.

How to make a scrolling background?

I'm making a Shooter game like "1943" and "Jamestown". I was wondering how I would make the scrolling background to simulate moving forward and How would I make this efficient? I was thinking about using a animated GIF or to make a looping BitMap. Please could someone help me out.
Thanks!
Take a look at the XNA framework for game development to develop a game that will use the computer's resources efficiently for smooth gameplay and frame rates. There are a number of books and online tutorials available.
If you're wanting a quick and dirty vertical background scroll in a windows form, you could always place a panel control inside another panel, set the outer panel to not display scrollbars, and make the inner panel twice as tall (or more), and set the background texture of the inner panel to be the background image you want to display. You can then animate the inner panel to move from top to bottom and reset back to the top when it reaches the bottom. Also be sure to design your background image so that the view at the top and the view at the bottom are the same for a smooth transition when the panel gets reset. You'll also want to call panel.Refresh() when you move the panel.
All that said, the XNA framework is really the way to go for game development.