Posts: 9
Joined: Jan 2009
Reputation:
0
2009-05-09, 11:02
(This post was last modified: 2009-05-09, 11:07 by MrBoxes.)
How do you make it so a picture only appears when your focused on a button then goes away when you go over a different button? to be more specific im not refering to the onfocus version of a button i mean in addition to that i want the background to change its picture while focused on that button.
code im working with
<control type="button" id="6">
<description>Settings</description>
<label>6</label>
<posy>540</posy>
<width>1920</width>
<height>150</height>
<onleft>5</onleft>
<onright>1</onright>
<onup>1</onup>
<ondown>1600</ondown>
<onclick>ActivateWindow(41)</onclick>
<texturefocus>H7_Selected.png</texturefocus>
</control>
if that helps
also i see Container(id).HasFocus(item_number) as a possibility but am unsure how to use it
Posts: 26,215
Joined: Oct 2003
Reputation:
187
You just use Control.HasFocus(id) as a visibility condition in your background image control.
Container(id).HasFocus(id) is useful if you have a bunch of controls in a group.
Cheers,
Jonathan
Posts: 9
Joined: Jan 2009
Reputation:
0
Oh, well my goal was to do what the Aeon skin did and make a different picture the background based on what "tab" or button you were on so then should i use Container(id).HasFocus(item_number) ? and if i should would the container id be the group id? and would has focus be the button id? not sure if i said that right.
also not quite sure what a background image control is lol im still learning the skinning engine.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
It completely depends on exactly what you are doing.
The usual way nowadays is to have a button control and an image control for each "tab" in your menu. The image control has a <visible> condition of Control.HasFocus(button_id), and has the background image for this "tab" in it's <texture> tag. Thus, it's only visible if the button has focus. PM3 does this for instance.
The use of Container(container_id).HasFocus(item_id) is used if instead of separate buttons you are using a list container (eg a wraplist) with static content. Aeon likely does this.
You really need to start by looking at a simpler skin such as the original PM3.
Note that there's going to be an easier way to do this in a little bit (meaning you can do it all with one image or multiimage control instead of a separate one for each "tab") but I'm still working on it.
Cheers,
Jonathan
Posts: 9
Joined: Jan 2009
Reputation:
0
2009-05-09, 11:32
(This post was last modified: 2009-05-09, 11:41 by MrBoxes.)
I understand most of the things i see while going through the skins learning how to make them the hardest part id say is figuring out how to reference other xml files or how they reference each other. Aeon for example feels extremely messy and has a lack of notes inside it to say whats what. i made a skin a year or so ago everything has changed a lot! thanx for the help.
also the skin im currently picking through is the focus skin
Amazing thank you again, found it right in the home.xml for PM3.HD
Posts: 9
Joined: Jan 2009
Reputation:
0
2009-05-09, 11:50
(This post was last modified: 2009-05-09, 11:58 by MrBoxes.)
Ouch, now i got hit with my menubar not showing up when im focused on the "tab". How does one make something always visible?
Never mind that, I figured it out. I'll stop bugging you now.