Unity stick image to the right of text with varying width - unity3d

So, I have a text which is centered in the middle of the screen.
To the right of that text i want to have an image stick to the text.
When the width of the text increases by X, I want the image to move to the right by X/2 and vice versa.
I already put a Content Size Fitter on that text, so the width of the Rect Transform is actually always just the width of it's content.
The thing that has to be done now somehow is to make the image stick to it.
Thanks in advance!

Wow, solved myself about 30sec after asking..
All I had to do was to change the anchor of the image to be the right border of the text instead of the left.

Related

Setting X of camera's viewport causes the black strip to be rendered

I’ve run out of ideas, please help me.
That's the situation:
Imagine a simple object in the center of screen (it's always so, because camera has an orbit script)
Then we add a canvas image, 300px width, for example, on the right side of the screen (blue one in the picture). Our cube is not centered anymore.
For example, we can change X property of camera viewport rect, but we'll get a black strip and if object appears in this zone, it would not be rendered.
So, what can I do to offset camera position?
Thank you in advance!
The best option I have for now is:
create basic UI for FullHD resolution and make right panel as wide as black strip is
if user's screen bigger than 1920px, than change Canvas Scaler mode from Constant pixel size to Scale with screen size

How to place a transparent image on top of another image?

I've tried placing a png image with a java.lang.String source on top of another image. I expected the top image to be transparent such that the bottom image would also appear, but it didn't work. Any clues on how to do this?
use z-index to position the top image over the bottom image and opacity to set the transparency of the top image.
Without some code to look at, (or a fiddle), it is harder to be more exact.

FPDF - image alignment

I've been trying to get an image to right align in a cell but have been unable to do so.
The image in question is a variable so I can't simply specify a coordinate as I can never know the width of the graphic. I've also tried the "R" option in a MultiCell but that appears to only work for text?
Thanks,
Jon
If you're loading an image, you could use php to capture the width of the image prior to drawing it on the page. Then simply subtract that width from the width of your .pdf page to 'fake' right alignment.

How to align an 90 deg rotated label perfectly with the pixels?

When rotating a label, the text is rendered very ugly. Is there an convenient way to get the label aligned with the pixels? Maybe there is some way of rounding the transform of the view, so that it isn't misaligned?
If you use CGAffineTransformRotate or a similar function you won't see any artifacts in the text because the label is drawn first and then rotated in its entirety.
If you are seeing artifacts using a transform, then the most likely source is a transparent label background distorting the appearance of the text. If the background is variable, such as pin stripe or a picture, then rotating the text will put different pixels adjacent to the text which can muddle its outline and apparent color.

UIImageView renders image differently to original

The image on the right is the one that I produced in photoshop. I then stripped all text and put it in an image view, as soon as I did that there was a change in colour and the vertical line lost it sharpness. Has anyone else run into a similar problem? What do I do?
alt text http://grab.by/1DuZ
Are the dimensions correct? Is the position of the image an integer? If these cases antialiasing will slightly blur your image.
One thing to be careful of is that if your image is an odd number of pixels in either dimension then centering it onscreen will cause it to be misaligned. Imagine if you had a 1x1 image (just one pixel) and tried to center it perfectly onscreen. It can't be done because the screen is an even number of pixels wide and high. This is why it's best to always use even dimensioned images whenever possible.