I'm working on a simple application with text animations and videos as background.
It's really similar to a simple LED scrolling text and I'm using the animations framework of WPF for this (Storyboards and timelines).
My text comes from the right side and finishes animation to the left side, thus it is visible for the entire width of the window.
Now, what if I want to display this text only in a specific rectangle of the window? The text would normally come from the right and finish to the left, but should be visible only when passing through this rectangle. Imagine it like a "rectangle hole" in the background where the text is shown.
I hope I have been straightforward in my explanation!
Thank you.
Is it an opacity mask you're after?
http://www.c-sharpcorner.com/uploadfile/dbeniwal321/implementing-opacity-masks-in-wpf/
Obviously you won't be using gradients of opacity as seen in the article - you'll use a more strict rectangle outline and play your animation as usual - using the bounds of the mask as the boundaries of your animation.
Text in a Canvas. Set the size and position of your Canvas to be your rectangle hole. With clipping on, when the text is outside the Canvas, it will not show. You just animate Canvas.Left attached property on your text.
Related
I am trying to make a game scene for Unity. However, I can't seem to get rid of this border. Or I can't seem to stretch my background to fit the whole screen. I need this scaling to work for all screen sizes. Here is an image of what is happening.
You can clearly see the blue edging, when I don't want that to be happening. This happens when I test on my Tablet as well. The camera is of size 5, however, when I do some debugging, I notice it gives me positions such as 7.15 when I touch on the screen. How can I scale everything down, I have searched through tons of forums and no one seems to be having this issue.
Are you using UI panel for the background? if so try these step.
1st strech the background Panel to fit the whole canvas size
then change the background panel to stretch in all directions
Then select the canvas object and render mode for screen space camera, assign your camera to it and change the UI scale mode to 'scale with Screen size'
Part of the problem I am having with what I am trying to do is trying to explain to others what I want. What I am trying to accomplish is an in-game pop-up menu or window which has its own Draw area. For example lets say I have a pop up window with multiple objects stacked on top of each other, such as button, but there are too many to fit on the window so you need a scroll bar to move them into view. What I want to do is make these object only Draw inside of the window:
http://imgur.com/8IWNEqN
The black area with scribbled pink is the main game window and the centre image is the pop up windows, the dark blue squares being the objects inside. Any code, suggestions, and mainly theory will be appreciated. I've tried drawing them only when they're inside the window and this works but it doesn't look very smooth, I want the object gradually disappearing as they move out the window, not just vanishing when they touch the borders, and especially not slipping out of the window.
Thanks.
Before you do any rendering in XNA you can set the ViewPort on the GraphicsDevice. This lets you restrict where things are being rendered.
For example, if you want to render something to a 100x100 pixel area at the top-left of your screen you might do:
// Create the rectangle
var clipRectangle = new Microsoft.Xna.Framework.Rectangle(0,0,100,100);
// Set the rectangle when you call SpriteBatch.Begin:
mSpriteBatch.Begin(SpriteSortMode.Immediate, renderStates.BlendState,
samplerState,
depthStencilState,
rasterizerState,
null, matrix,
clipRectangle);
I'm trying to create an image slideshow just like this one on this page: http://forum.xda-developers.com/forumdisplay.php?f=1914
If you mouseover the image of the tablet, two arrows appear and you may slide through these images.
How to achieve this with wpf?
I want to create it just like on the page, I press the right arrow and the current image moves left out of sight and the new image comes to the center from the right.
The application should be resolution independet, so working with a canvas isn't possible I guess.
To give a general answer to that question without writing the code for you(, which is your task):
Create a Grid with the size of one image. Create a Canvas with the HeightProperty set to the height of the images and the WidthProperty to the sum of the width*amount of images.
Next thing, add two images for the arrows and the canvas as children to your grid and position them correctly.
Second last thing. Create an event for the grid MouseEnter to change the IsVisible property of the arrows to true and one for MouseLeave where it is set to false.
Last thing. Create events for LeftMouseButtonDown for the two arrow images that will trigger a animation that changes the Margin.Left property of the canvas by the width of one image.
Ok so I have a custom control and I am applying a background gradient to it. The control that it is in is set to anchor left and right and the image is set to Stretch on the control.
Here is what the background image looks like when its in the normal size of the form.
Here is what the background image looks like when the control is stretched.
Obviously I want it to look like the top one as far as the edges go. I am using Inkscape to develop the background image. Any help on how to avoid this blurry edge would be much appreciated.
I suggest trying 9 images in your control, one for every edge and one for every corner plus the middle container, maybe you've seen this technique in a lot of websites. If you set all images with good anchor, the top and bottom edges will stretch only sideways and the right and left will stretch upward and downward. The corners would never change and the container would be completly stretchable. I am worried about flickering though since it is in a winform. Worth trying.
If you use a fixed image, even if it is bigger and you shrink it, you'll lose the corners proportions.
When the system resizes the image it is approximating the missing pixels in the new stretched image. There is nothing you can do to prevent the blurring from occurring. The only sensible option I think is adding the image in higher resolution (which should be easy since you use Inkscape to create them) and have the system shrink it instead of stretch it.
I've seen apps that place a colorful border or image around split view controls. To me, it looks like these apps add an image to the window, and then resize the split to be slight smaller then the screen.
How to change background graphic/theme in splitview on ipad?
http://www.iosinspires.me/category/appinterfaces/post/446/Timix_Interface.html
I've tried to manually resize the UISplitView by changing it Frame (UISplitViewwill resizes to cover screen), or by setting a border width, with a clear color (border is ignored when clear).
Does it look like the two examples used split views? Is that the correct control to use for this look?
Would this help?
https://github.com/mono/monotouch-bindings/tree/master/MGSplitViewController