Edit camera center directly and instantly in Mapbox GL JS - mapbox

I want to edit the camera center directly in Mapbox GL JS. I know about the existence of the map.easeTo and map.flyTo methods but I do not want to use them because I have to do multiple requests to them (around 60 per second), which in turn results in decreased performance because transitions are stacking upon each other (only an assumption from my side).
Essentially, instead of doing map.flyTo or map.easeTo, I want to do change the camera center directly and instantly. Alternatively, I would like to know if it is possible to remove all the previous transitions before calling map.flyTo or map.easeTo.

To update the camera without an animation use Map#jumpTo.
If you're trying to do your own smooth camera animation you might want to also use requestAnimationFrame like in https://docs.mapbox.com/mapbox-gl-js/example/animate-camera-around-point/

Related

continuous drag or scaling in leaflet

at present our project is using the leaflet, I take the map parameters to background program (map.getZoom() and map.getbounds()) , then load the returned picture(return from background program) by imageoverlay.
excuse me how to solve continuous drag or continuous scaling, only the implementation of calling a daemon?
If you mean you dynamically load the base map (i.e. the image that is zoomable, draggable and that fills a big pane, not just a small portion that would have needed a single image overlay), you should probably rather do it through a Canvas Tile Layer:
Used to create Canvas-based tile layers where tiles get drawn on the browser side.
With this, you set up a myCanvasTileLayer.drawTile function that is called by Leaflet anytime the map needs more tiles (due to user panning / zooming). Please refer to Leaflet doc for the function arguments.
If you want to stick with your image overlay technique, you might want to listen to drag and zoomend map events to re-trigger your function that loads a new image overlay.

How to apply a postprocess effect to a UI element

I have a post-process effect that uses Unity's Graphics.Blit to pixelate or apply a crt-screen effect to a scene. There are some UI elements that display after the fact (basically making it not a true post process, but let's put that aside for a moment).
Now, I want to apply a second process that performs a screen wipe and transitions out one scene for another. This time I want to include the UI buttons in the effect.
I've looked into using a render texture and then rendering to a second camera, but I feel like there is a smarter/more accurate way to handle this.
1st version of this question:
Can I selectively include the screenspace-overlay UI in the script that applies the post process?
or, 2nd version of this question
Is there a trick to getting the render texture to preserve resolution and display accurately (i.e.: without lost quality) when re rendering to a second camera?

how to create dynamic UI that adjust itself to current screen dimensions after loading?

I have created a level editor using new UI system in Unity3D.
Using Level Editor:
I can drag the ui elements,
I am able to save them in scriptable objects
But how could i save and load them at runtime?
I mean, if i create a level with some {width x hight} resolution and if i load it on different resolution, then the whole UI positioning get distorted.
How could i anchor them correctly programmatically?
Any help would be appreciated.
There are good video tutorials about the 4.6.x UI here:
http://unity3d.com/learn/tutorials/modules/beginner/ui.
Especially for positioning the elements I recommend watching: http://unity3d.com/learn/tutorials/modules/beginner/ui/rect-transform.
I suggest you learn how to use the anchor correctly first. If you want to change the position and size of UI element in a script you can do that through the RectTransform component. It offers functions like offsetMax,offsetMin and sizeDelta for position your UI element. The functions you need to use depend on your anchor setting.
as LokiSinclair said. You just need to Adjust the Scale that the new UI provided. It is the four Arrow on the Canvas of each Object and every UI object is inheriting their scale behavior from their Parent.

switching from one camera to other in unity ,view entering from right

I have two cameras in the same position.I want to switch from one camera to other (with a transition effect) such that second view replaces the first camera view entering from the left side moving inwards and filling the screen.. Camera fading in and fading out effects are available in unity wiki..Can anyone suggest me a technique to achieve this effect..
You can try to animate Camera.rect. Otherwise you will have to render both in a RenderTexture and combine rendered images in a small shader with a translate parameter changing from 0 to 1.
While i'm not really really sure of the application for the switching of the camera if you were to instantiate it dynamically you would be able to use lerp and other function calls to manipulate behavior and not need to use multiple cameras.
http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Lerp.html
As a side note i'm sure you could reverse engineer some camera effects similar to this one in order to achieve the background(a little confused about what you want to do with that)
http://docs.unity3d.com/Documentation/Components/script-CameraMotionBlur.html

OpenGL ES : Revealing underneath view

I am working on a sample in which I have placed two textures one above the other. What I want, whenever user moves his finger on the screen, underneath view should get revealed as he moves. Wiping out front view to reveal underneath view is what I am looking for.
I would like to know some of ideas/ thoughts to implement this feature using OpenGL ES. Any related pointer will be highly appreciated.
Thanks in advance.
This does not sound performance-intensive so simple code can trump complicated tuned operations.
You don't need to use OpenGL. You can simply have two images - front and back - with the front supporting an alpha channel. Each time you get a hit or move, you clear a circular patch whereever the impact is for some certain radius or such.
And then queue-up a redraw. The redraw draws the two bitmaps, back first then front.
If possible, try to queue a redraw for just the the area where you have updated the front since the last draw.