I’m trying to create a menu of buttons for a game, a constant div throughout the game with buttons in fixed positions.
This adds the base of the menu to the body of the game.
Javascript/jQuery
(function() {
const actbar = jQuery(document.createElement('div'))
.attr("id", "action_menu");
jQuery("#story").append(actbar);
$(document).on(':passagedisplay', function() {
setPageElement('action_menu', 'ActionMenu');
});
})();
CSS
div #action_menu {
overflow: hidden;
font-size: 1.2em;
background-color: rgba(0, 0, 0, 1);
padding-left: 20px;
position: fixed;
left: 14.5em;
bottom: 0em;
height: 8em;
width: 85%;
}
#action_menu .link-internal {
width: 10em;
border: 3px solid #7fc7e3;
color: #7fc7e3;
background-color: transparent;
text-align: center;
border-radius: 10px;
display: inline-block;
font-family: 'cursive';
text-decoration: none;
margin-top: 15px;
margin-left: 12px;
padding: 0.25em 0.75em;
}
And then the ActionMenu passage containing the links, but this adds a row of links that change their positions drastically according to the resizing of the screen.
At the normal screen (100%)
But if the screensize changes…
I would like the links to remain fixed in their positions.
Twine Version: Twine 2
Story Format: Sugarcube 2