separating imageUp and text in ImageTextButton - libgdx

How does one set the spacing between an imageUp and text in ImageTextButton.Style? The default positioning looks like this
, but I would like to move the image more to the left while keeping text centered. Is such thing possible in libgdx?

found one approach
imageTextButton.getImageCell().pad(//set padding);
or
imageTextButton.getLabelCell().pad(//set padding);

Related

text cropping to the center

Is there any way to make visible only middle part of the text/symbol(img1 blue lines). By default if there is not enough space inside of a text container then text is cropped only from the bottom side and we'll see only top part of the text. Yeah I know that I can set negative margin but in this case I'll need to set different values depending on the font size but I'd like to make it independent from the font size.
What is it for? I'm using Google material icons font. Some icons are smaller than required(for example arrow_drop_down is very small).in my case best size for it is 1rem but red part of my button(img2) should be much smaller. On img2, the red part should be ~3 times smaller and contain only that triangle.Now red's height = font size.
What you're trying to do can be done with adjusting the line-height.
Also live examples are always better than bunch of pictures , especially since this example would be easy to set up.

Problems with aligning contents grid-wise using float

Look at this image: http://i.stack.imgur.com/KZCXn.png
I'm using 'float:left' to align contents of my website grid-wise.
On the left side, the space between the two objects is 24px, whereas on the right side it's 10px. It is happening automatically because of using float. I don't want the spaces to be different on both sides if the boxes are of different heights. I want the alignment to be like facebook timeline.
You will need to use something like Masonry: http://masonry.desandro.com/. HTML/CSS can't do it by itself.

Position:Relative image that doesn't push nearby text?

Simple question: I need an image to appear in the middle of a paragraph of text, however, the image is slightly larger than the height of each line of the font, so it pushes open a horizontal "gap" in the text to make room for itself. To fix this, I could:
1) Shrink the image, so that it is not larger than the font.
2) Use Position:Absolute
But I don't want to shrink it any further, it is small enough already to "technically fit" between each line of text, except that it would need to use up a few pixels of the white area above and below the line of text it is in.
And I can't use position:absolute, because then the image's position would be in the top left corner of the window, instead of in the paragraph where I want it.
I thought perhaps I could put a dummy "placeholder" image of size 1 pixels into the paragraph. Then, use Position:Absolute on my real image, and continually set my real image to be at the same location where the dummy image is. I haven't researched to see if that is possible, but it seems a bit excessive for such a simple thing. Is there an easier way?
EDIT: I found that adding: margin:-20px; to the image's style works!!!
margin:-20px;
JSFiddle example: http://jsfiddle.net/j7tLX/3/
Images are block level elements if you want them to appear inline with the paragraphs. Do this.
img {
display: inline;
}
You can use vertical-align: top
http://jsfiddle.net/j7tLX/4/
See http://css-tricks.com/what-is-vertical-align/

rotating text on a table using css3

I am trying to create a table for printing purpose.
As seen in many forms, I want vertically rotated text and both left and right side of the form.
So far I have achieved this
Fiddle: http://jsfiddle.net/naveen/P8AZD/
This has two problems
I wanted the border td widths as 50 px with the text spanning more area. Currently the rotated text also gets clipped to 50px. How to overcome this?
The style rotate-right has incorrect filter: progid:DXImageTransform.Microsoft.Matrix. It has been copied from .rotate-left. What does the values (M11, M12, M21, M22) in the filter denote?
What is wrong with my code?
See http://jsfiddle.net/P8AZD/7/
I added a div around your text and made it not wrap

How to set in a td image and text position

I want to set up next to my image a text - they are in one td, but when i set upt the text it starts from the end of the picture, how to set it up to start from the starting point next to the picture ?
You can use
style="float:left;
on the Image. This class will make the image float to the left and other text will start just after that.
try it
Lots of options:
Set the align attribute of the image to either left or right
Put the image in a separate table cell (<tr><td>Tekst</td><td><img... /></td></tr>)
Make the image a floating element by setting float to either left or right using css
…