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/
Related
I have settings screen within my game for resolution. Within this setting page, you have a fullscreen ON and OFF option. I also have a resolution switcher above it. However when you turn fullscreen off and change the resolution. The game is no longer centered on the screen and moves around as you change the resolution. I have tried many things such as window_center() within the switch statement. However this isnt solving my issue. Does anyone have any ideas on how to keep the game centered on the screen when changing resolutions with fullscreen turned off? (Such as a windowed fullscreen)
You'll want to either delay window_center call by 1 frame (as the window position data doesn't update till the end of the frame), or use window_set_rectangle to calculate position yourself immediately, like so
window_set_rectangle((display_get_width() - width) div 2, (display_get_height() - height) div 2, width, height);
(or slightly more complex if you want to resize window relative to the current position)
I have two coordinates that represent a portion of a route, and I want to orientate the MKMapView such that the route, polyline is displayed going from the bottom of the screen to the top of the screen.
Currently I first calculate the angle between the two coordinates, and then rotate the map by setting the camera heading, where 90 degrees is facing north and vertically centred on the screen.
Is there perhaps an easier approach, sample code would be great in either Swift or Objective-C.
Currently I first calculate the angle between the two coordinates, and then rotate the map by setting the camera heading, where 90 degrees is facing north and vertically centred on the screen.
You've got the right idea. There's no way to set the map view's heading directly, so setting the camera heading is the right way to go. Be sure to set the map view's rotationEnabled property to YES to get the map view to use the camera's heading, and if you want to always see the map in plan view (i.e. looking straight down), you can set pitchEnabled to NO.
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.
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
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.