Scrollview Viewport Mask not hiding content - user-interface

Here is a screenshot of my scene:
I'd like to have a grid of prefabs which I can scroll through. The grid works and the scrolling works, but the mask on the viewport does not hide the content. I've tried selecting/deselecting the "Show Mask Graphic" option, I've tried using a Rect Mask 2D instead and in addition, and I've tried putting mask components on the ScrollView itself. I'm at a bit of a loss for what to do.
How can I prevent the content from appearing if it is not within the viewport? Here are some screenshots of the scene objects' inspector properties:
ScrollView:
ViewPort:
Content:
GameObject Prefab:

Because those are Sprites, not UI.Images
The Unity UI Mask object can only mask other UI elements. Sprite is not one of those. You should change your prefab to have an UI.Image component instead.

Related

How can i do a fill animation in Xamarin.Forms

I need to fill up an polygon with Xamarin.Forms. Imagine a square and fill it with some color with animation.
The easiest thing you can do is to use a BoxView view with Opacity set to zero and Color set to your desired color. Then do the animation with yourBoxView.FadeTo or yourBoxView.TranslateTo method.
If you need a border you have to make a custom render for a ContentView with border support and then put your BoxView inside it or you can use FrameView (rounded corners). http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/
This does something very similar: https://www.youtube.com/watch?feature=player_embedded&v=55r1wHdOLBo

Combine sprite animation with path movement with CALayer

In Monotouch, I need to create a basic animation of an image moving along a path while animating it's image content with a sprite sheet or replacing the content CGImage, everything i try i can't combine both animations. I tried subclassing the CALayer and animate custom properties or combine animations in group nothing seems to work. What's the best way to produce this kind of animation?
To get a smooth animation, you want to think of what CAlayers represent: they are a handle to a texture that live in the GPU space. To get smooth animation you can control a few of their properties, but arbitrary changes like rendering the data again wont work fine.
What you should do is put all of your images in the sprite sheet, and then animate the ContentsRect property of the CALayer.

Draw rectangle with Mouse on HTML5 Video using javascript

I have embedded a Video in HTML5 page over a Canvas.
I want to draw a rectangle with mouse events on the Video and rectangle should not be erased.
Please help me how to do this ..
Thanks..
You can create a new Canvas Element just on top of your Video-Canvas. and Handle your mouse events for that new canvas element. and Make sure that you do not set the background property for your new canvas, this will make it transparent and the Video-Canvas elements content will be visible. Let me know if you do not get it.

changing the color of the button in selectfield/datepicker/timepicker in Sencha

Is it possible to change the color of the button (the little triangle button) shown in the right side of selectfield/datepicker/timepicker?
those little triangles are constructed using images as background so you need to change those images to change color of those triangles
for datepicker image is "resources/themes/images/default/form/date-trigger.gif" in css class .x-form-date-trigger
for timepicker/selectfield image is "resources/themes/images/default/form/trigger.gif" in css class .x-form-trigger

Imagen from Canvas

I'm trying to get the data from a canvas and set the src attribute of a img element. The problem here is that, the canvas has a background image setted with css, not with canvas methods. Is there any way or method to extract the background image so the toDataURL method could catch it?
Thanks
I guess there is a solid reason why you are not drawing the background image to the canvas itself so I can offer you this solution:
Draw the background-image to a second canvas element positioned below the first canvas.
When you want to take the canvas data and use it create a third canvas (no need to attach it to the DOM or make it visible.
Draw the background canvas onto it and then draw the main canvas on top.
Take the data from the third canvas.
Voila.

Resources