Libgdx scene2d window title size - libgdx

After setting up a scene2d window and setting a title, id like to be able to adjust the height of the title bar.
If thats not possible is there a way of finding the current height of the bar? as this would make placing tables and other actors within it a lot easier?

You can change the height of the back of the title bar by modifying the 9 patch graphic used for the background of the window. It's just the top of the window image.
The title available via window.getTitleLabel() is the text label placed on top of the top of the underlying window graphic.

You actor will always be added bellow the title bar, you can adjust using padTop().
To change the title bar size you can change the font of the title size.
I never found a better way to manage this.

you can get the title label through window.getTitleLabel(), then modify it.

Related

Responsive design: Image-based Navigation > scale images equally

Situation:
I created a full screen layover navigation for a html5 webpage including links displayed as images. I used images because of the special hover effect, which is not possible in code.
This means that my links such as Home, About, Portfolio, Contact are made out of images (and not text) and displayed in a list.
I created two images per link: 1 for normal state and 1 for hover state.
I used the replacing img technique shown here:
.foo img:last-child{display:none}
.foo:hover img:first-child{display:none}
.foo:hover img:last-child{display:inline-block}
Issue: The navigation works well on a large screen, but the trouble starts when scaling-down the viewport. The images controlled by max-width behave separate from each other and do not scale at a similar rate when scaling down the screen. Of course this relates to the biggest image (which hits the viewport border) to scale first and the smaller later. In my case: the Portfolio image will scale earlier than the Home image. This results in a strange looking navigation, as the images differ in size at some point.
Some other elements I considered:
I can make smaller images for smaller screens, but that would make a lot of images too load.
I can make all images the same size as the biggest image. But it means the smaller word will have empty spaces on the left and right of the word. This empty space will also activate the hover state, which makes it look strange (hover state activates while I'm not on the link itself (visually, not technically).
Question:
How can I use an image-based navigation and scale down the navigation links/images equally when scaling down the viewport?
I made a JSFiddle for testing: DEMO
Thanks in advance.
I've been looking at this for a while and I'm beginning to think this isn't possible. The root of the problem is that each image would need to be aware of the largest image, or at least each of the <li>s would need to be aware of the other ones' dynamic height, which isn't possible with some sort of DOM manipulation. Even with flexbox I'm unable to make this work.
My advice would be to create each image the same width, using PNG transparency, then simply use an image map to activate the hover state over only the button area of each image. It's a bit of work but I can't think of a better way. See this StackOverflow question for ways to make the image maps.

How to make an image ignore the size of the viewport?

I'm going to try to explain what I want to do with screenshots.
This is how my website looks right now, screen size 1920x1080:
https://gyazo.com/95cc6f61a449f67fb00232a7619a58d7
This is how I want my website to look:
gyazo.com/c5cf33080a04f0d3d9b5b0252f013ba3
BUT! I don't want the logo to resize itself, I want it to remain the the relative position of the shape it's on after it got resized.
Practically, I want the shape to remain the same size regardless of resolution, how do I do this?
I tried editing the CSS and using the 100%/auto trick but it's not what I want to do.
http://www.templatemonster.com/demo/58241.html is what I'm trying to replicate in my example. (THIS IS ALL FOR LEARNING PURPOSES)
Try zooming in or out on that page and you'll see the shape is keeping it's form regardless of zoom level.
To keep the logo from resizing you need to set fixed width and height with a pixel value. Ex: 150px. That should keep it from resizing itself.
Keep in mind that to replicate that example, you need to involve the original logo with a responsive element.

Make a 'width: 100%' image placed below navigation become a background of navbar on mobiles

If you look at what happens here when you reduce the screen width is that the big photo becomes shorter and shorter, still filling in the full 100% of the width:
https://mmistakes.github.io/minimal-mistakes/
Now, I don't find that appealing and would like to make that photo disappear and become a background of the whole top (navbar) part once the navigation bar becomes the button. However, I would like only a certain part of the photo to show up, not the whole width.
Any hints on how to achieve that?
Update: the tricky part here is that each page has its own image. Since this is jekyll, in theory, I could add a css entry in the <head> of each generated page for setting the background image of the navbar, but I'm not sure whether there is a more elegant solution.
Put the picture as a background for your nav-bar and use the css background-position attributes.
Use viewport and let the image (the img-tag) disappear

Adobe Edge Animate: Is there a way to use CSS media queries to resize an image?

I'm using Adobe Edge Animate and I'm really having trouble with all the different screen sizes and resolutions. I see that Adobe is coming out with new products which may address this issue. Basically all I'm tryng to do is have an image display (like a banner for example) that fills the width of the user's screen. I see the following questions, but answers are old and I know that there has been a lot of development in this area. Any ideas greatly apprciated.
Stackoverflow questions
From the splash screen. In the Properties tab change the switch next to the width to make it 100%. Select the Max W parameter and change this to too. All these tweaks will make the layout responsive. Next drag the image onto the stage and position in the top-left corner. In Properties click on Use Presets for Responsive Layout and choose the Center Background Image option, then Apply. This means the image will stay central whenever the stage morphs. Drag the bottom-right corner handle so the image fits over the entire background. Notice the image doesn’t scale or stretch but stays in the centre. In the Position and Size tab is an expand button; click this and add a Max W of (how many px your image is). Change the width to 100% and press Enter. It will jump right back to 75% but it has accepted the change. Click on the resize marker and drag to the left to see what happens when the stage is resized to a smaller layout. As you can see, the background is clipped but the image resizes to fit.
Here is a link to the tutorial I think this will better answer your question if you do this tutorial. http://www.webdesignermag.co.uk/tutorials/create-a-responsive-animation-with-adobe-edge-animate/

Align background image with a an image with HTML and CSS

First time on stackoverflow, also my first time with HTML and CSS.
Basically I want a transparent image to be kind of "hooked" on to one specific point on the background, i.e. if I resize the browser window, the image should maintain its position relative to the background and should get smaller accordingly.
The reason I need this is because the image is animated and positioned to a certain spot on the background.
The easiest way I could show it is by actually showing it so: www.opinionoto.com
As you can see I want the speech bubble to always be right beside her face and maintain its position no matter what device or browser size.
This would be great help for me, I'm a super begginer! Thanks in advanced!
why not use multiple background images and position the second one accordingly where ever you need it?
Does the bubble move after the initial move? Can you just make the background a GIF image?