Current state in a button element


(ilkka_kumpunen) #1

Would it be possible to add a current state feature in button element? I need it quite freaquently.


New button state - Last pressed
(Hans-Gerd Claßen) #2

well, hype collects touch and mouseevents for domelements in the bahaviourspalette. so you can easily grab it there adding a js-line which sets a variable. this info could be reused somewhere … But have to say that i’m not sure what you’re issue is …


(ilkka_kumpunen) #4

To clarify my point:

Here is simple css code example, what I have been using creating navigations. I can tell user with this where he/she is at a moment.

navi1 {
width: 150px;
padding: 0px;
margin: 0px;
display: block;
color: #000000;
}

navi1 ul {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
list-style-type: none;
text-align: left;
padding: 0px;
margin: 0px;
float: left;
}

navi1 a:link, #navi1 a:visited, #navi1 a:active {
color: #000000;
text-decoration: none;
display: block;
width: 150px;
padding-top: 6px;
padding-right: 0px;
padding-bottom: 6px;
padding-left: 0px;
margin-bottom: 1px;
margin-left: 0px;
text-indent: 15px;
border-bottom-width: 1px;
border-bottom-style: dotted;
border-bottom-color: #000000;
}

Here, hover and current states of the button are the same and command can be given in css.
navi1 a:hover, #navi1 a.current:link, #navi1 a.current:visited {
display: block;
text-decoration: none;
color: #000000;
}

#D1 p {
margin: 0px;
padding: 0px;
}


(Hans-Gerd Claßen) #5

if you want to do a navigation including currentscenebuttons with hypetools you have to use persistant symbol and within some custombehaviour which switches buttonappearence on timelines. You can call this custombehaviours on sceneload.
Another way could be to run js on sceneload that changes the appearance of a button depending on a class or whatever …