MKUserLocation — how to stop pulsating circles from blue point? - location

I use MKUserTrackingBarButtonItem to change tracking modes.
In MKUserTrackingModeNone mode I would like to see blue point without pulsating circle.
Is it possible?
P.S. As I see in standard Maps application pulsating circles used only for determining location, after that it is just a blue point.

It stop by itself on real device, showing the range of location,
but in iOS simulator it pulsating every time :)

Related

DirectX Resize shows win32 background at Edges

When resizing down in DirectX I noticed a flicker along the bottom/right edges.
If you fix the size of the swapchain (in red), and set the win32 background to green you will get the following on a resize down:
It appears that the window size lags behind the mouse position ("Drag Rectangle") but the area DirectX fills (in red and black) matches the Drag Rectangle, with the remainder to be painted with the window background color (green).
The DirectX Utility Toolkit (DXUT) didn't have this problem. Experimenting with their settings I found that setting DXGI_SWAP_CHAIN_DESC::SwapEffect = DXGI_SWAP_EFFECT_DISCARD would just paint the screen green (the window background color) during a sizemove. I assume that DXUT has their own special handling for when win32 enters a modal sizemove loop in order to display DirectX content during a sizemove.
DXGI_SWAP_EFFECT_DISCARD is part of the old blit mode presentation model. Notably it cant have DXGI_SWAP_CHAIN_DESC1::Scaling = DXGI_SCALING_NONE the scaling must be stretched to the window size. So my best guess is this behavior is due to the implementation of the flip presentation model (it flips a rectangle too small (black) and then covers by painting the rest green).
Does anyone know how to stop the win32 background from showing?
Edit:
Thanks to IInspectable! I can confirm the WS_EX_NOREDIRECTIONBITMAP extended style works: it stops the artifact from the win32 background showing
I reproduced the exact same behavior when using CreateSwapChainForComposition() with DirectComposition as I got using CreateSwapChainForHwnd().
This means that there are two path for pixels to get to the screen. The green pixels are going through the Redirection Surface. Hence, explicitly requesting WS_EX_NOREDIRECTIONBITMAP prevents any drawing through a Redirection Surface stopping the win32 background from showing.
The other path is the flip presentation behavior which is how the red and black pixels are get displayed. Hence, not using flip presentation when resizing also stops the win32 background from being shown.
There must be a bug with DWM: when there is a Redirection Surface, the clipping to prevent the swapchain's contents extending past the window is smaller than the redirection surface allowing it to be seen along the bottom/right edges.
There are two observations of interest:
when using WS_EX_LAYOUTRTL or manually positioning a IDCompositionVisual to the right edge of the screen with GetClientRect(), the swapchains contents are correctly position, but still clipped.
when using WS_EX_NOREDIRECTIONBITMAP the window`s nonclient area lines up with the contents of the swapchain rather than the swapchains contents being clipped
These observations would seam to imply that the cause of the issue is that DWM is using it's prefered size for the window size sometimes and the size of the redirection surface othertimes.

Change Color after trigger or cross a cube in Unity

I am new in Unity and I have a question, I have a sphere(player) and 4 cubes, two is red and two is blue (which they are aligned with each other), and there is one black cube in the end, what I want is that after crossing that black cube is two change the color to red or blue, and I want if the sphere(player) is red it could walk in the red cube but when it touches the blue cube it stops, and the same thing with the red, so anyone can help??!!, I really need help because this is the last part of my project.....
Regards.
Osama
You need to create an empty game object with a 3D Collider on it
check the checkbox of the collider so the collider becomes a trigger
write a script with one or more of these functions depending on the behavior you want
https://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html
https://docs.unity3d.com/ScriptReference/Collider.OnTriggerExit.html
Then you need a reference to your four other cubes and change their color.
https://docs.unity3d.com/ScriptReference/Material.SetColor.html
EDIT:
Generally we are here to help you and not to do the work for you. I highly suggest you follow some tutorials on how to script in unity.
If you want to "walk through" gameobjects you will need to enable and disable the collider or the whole object based on trigger collision.
https://docs.unity3d.com/ScriptReference/GameObject.SetActive.html
https://learn.unity.com/tutorial/enabling-and-disabling-components#

Libgdx | Set black color to everything outside of circle

How can I set a black color to the whole screen, excluding a shaperenderer circle? The circle is basically my game world, anything that leaves it shouldn't be visible. Is there some way to create a reverse circle pixmap (eg..A circle, but inverted) to overlay everything except for the circle game area? Or maybe a way to clear the screen, excluding parts? Thanks!
You could try the approach you mentioned in the comments. Using a black image with a circular hole in it. Then have each assigned to a different camera much in the same way you would set up a HUD in libgdx.
You might want to take a look at shaders, this approach is really flexible and lets you even control how rapid the transition is. Just the basics of GLSL should be sufficient.
https://www.youtube.com/watch?v=caQZKeAYgD8 Here's a decent tutorial.

Colour transition in d3 always starting with black

I have made a small example showing the problem: http://bl.ocks.org/nvcleemp/df035fc9c14f9955d4f0
When you click any of the two links, then you see a small animation which changes the background colour. This animation always starts from black, while I want it to start at the current colour. This is just a small example, in the real problem there are many more links that have to change colour, and I don't 'know' which is the correct starting colour. (I can always look it up, but I cannot hard-code it into the function)
The safest way to have a transition start from a well-known state is to set that state yourself. In your case, set the background colour at the beginning:
d3.select("#test1").style("background", notSelectedColor);
d3.select("#test2").style("background", notSelectedColor);
Complete demo here.

Determine if a rect is visible inside window

I would like to determine if a rect inside a window is completly visible.
I have found RectVisible, but that function determines if any part of the rect is visible, I want to know if the entire rect is visible.
Is there any function for this?
First get the system clipping region (the visible region of a window) into a region by using GetRandomRgn. Read more about the 'system region' here. Then, offset that region since it is in screen coordinates (the article I linked has an example). After that, create a region from your rectangle with CreateRectRgn and combine the parts of your 'rectangle region' with those that are not part of the 'system region': that is calling CombineRgn passing the rectangle region as the first region, and the system region as the second region, and RGN_DIFF as the fnCombineMode. If the result is NULLREGION then your rectangle is fully visible - it is not fully or partially covered by any window (top level or not), or it is not fully or partially off-screen.
All in all, there's a probability that you're approaching your problem the wrong way around. If you've told what you've been trying to achieve someone could probably suggest a simpler approach.
Use PtVisible on each corner of the rectangle.
The PtVisible function determines
whether the specified point is within
the clipping region of a device
context.
Can you do a simple comparison using the coordinates of the window and the rectangle.
Check the rectangle's left ordinate is to the right of the Window's left border; the right ordinate is to the left of the Window's right border; and similar for top and bottom?
The only wrinkle might be if you are using both logical and physical coordinates, in which case you will need to perform a transformation.
All the functions that dealt with clip rectangles and point visibility broke with Windows Vista's new desktop composition feature. The functions will work fine on Windows XP and earlier, and on Windows 7 with Aero/Desktop Composition turned off, but otherwise, they will always claim that the entire window is visible.

Resources