newbie tips please (1 Viewer)

robomonkey

Portal Pro
August 4, 2005
207
1
I'm stumped with this, my home.xml file is below, yet none of the components show on screen except for the background.

Any help would be appreciated.

Ta

<window>
<id>0</id>
<defaultcontrol>2</defaultcontrol>
<allowoverlay>yes</allowoverlay>
<controls>

<control>
<type>label</type>
<description>template label for small font</description>
<id>9001</id>
<posX>0</posX>
<posY>0</posY>
<visible>no</visible>
<label>-</label>
<font>font16</font>
<textcolor>ffffffff</textcolor>
</control>
<control>
<type>image</type>
<description>background image</description>
<id>1002</id>
<posX>0</posX>
<posY>0</posY>
<texture>background.png</texture>
</control>

<control>
<type>image</type>
<description>MP logo image</description>
<id>2001</id>
<posX>32</posX>
<posY>16</posY>
<width>400</width>
<height>80</height>
<align>left</align>
<texture>MP_HomeLogo.png</texture>
</control>
<control>
<type>label</type>
<description>Date</description>
<id>2002</id>
<posX>32</posX>
<posY>96</posY>
<label>#date</label>
<align>right</align>
<textcolor>ffffffff</textcolor>
</control>
<control>
<type>label</type>
<description>Time</description>
<id>2003</id>
<posX>256</posX>
<posY>96</posY>
<label>#time</label>
<align>right</align>
<textcolor>ffffffff</textcolor>
</control>



<control>
<type>image</type>
<description>template for panel in which all buttons should b fitted</description>
<id>3001</id>
<posX>564</posX>
<posY>130</posY>
<width>300</width>
<height>270</height>
<texture>-</texture>
</control>
<control>
<type>button</type>
<description>template for button</description>
<id>3002</id>
<posX>564</posX>
<posY>130</posY>
<visible>no</visible>
<texture>hp_selectionbar.png</texture>
<label>605</label>
<font>font16</font>
<width>225</width>
<height>49</height>
<textcolor>ffffffff</textcolor>
<textYOff>12</textYOff>
<textureFocus>hp_selectionbar.png</textureFocus>
<textureNoFocus>-</textureNoFocus>
</control>
<control>
<type>image</type>
<description>template for hover image</description>
<id>3003</id>
<posX>32</posX>
<posY>256</posY>
<width>146</width>
<height>234</height>
<visible>no</visible>
<align>center</align>
<texture>-</texture>
</control>

</controls>
</window>
 
December 28, 2005
237
3
Sydney
Home Country
The only things I can say is that you keep the “controls†layers in to same way as u want them come up on your screen, add specify the image size.

Ooo, and yes I remember when I started playing with <id> numbers some of my images/button didn’t show.

<window>
<id>0</id>
<defaultcontrol>2</defaultcontrol>
<allowoverlay>yes</allowoverlay>
<controls>

Move tbackground image to be first.
<control>
<type>image</type>
<description>background image</description>
<id>1002</id>
<posX>0</posX>
<posY>0</posY>
*************************************
<width>1280</width> <<<<<Add image size.
<height>720</height>
*************************************
<texture>background.png</texture>
</control>

<control>
<type>label</type>
<description>template label for small font</description>
<id>9001</id>
<posX>0</posX>
<posY>0</posY>
<visible>no</visible>
<label>-</label>
<font>font16</font>
<textcolor>ffffffff</textcolor>
</control>

<control>
<type>image</type>
<description>MP logo image</description>
<id>2001</id>
<posX>32</posX>
<posY>16</posY>
<width>400</width>
<height>80</height>
<align>left</align>
<texture>MP_HomeLogo.png</texture>
</control>

<control>
<type>label</type>
<description>Date</description>
<id>2002</id>
<posX>32</posX>
<posY>96</posY>
<label>#date</label>
<align>right</align>
<textcolor>ffffffff</textcolor>
</control>

<control>
<type>label</type>
<description>Time</description>
<id>2003</id>
<posX>256</posX>
<posY>96</posY>
<label>#time</label>
<align>right</align>
<textcolor>ffffffff</textcolor>
</control>

<control>
<type>image</type>
<description>template for panel in which all buttons should b fitted</description>
<id>3001</id>
<posX>564</posX>
<posY>130</posY>
<width>300</width>
<height>270</height>
<texture>-</texture>
</control>

<control>
<type>button</type>
<description>template for button</description>
<id>3002</id>
<posX>564</posX>
<posY>130</posY>
<visible>no</visible>
<texture>hp_selectionbar.png</texture>
<label>605</label>
<font>font16</font>
<width>225</width>
<height>49</height>
<textcolor>ffffffff</textcolor>
<textYOff>12</textYOff>
<textureFocus>hp_selectionbar.png</textureFocus>
<textureNoFocus>-</textureNoFocus>
</control>

<control>
<type>image</type>
<description>template for hover image</description>
<id>3003</id>
<posX>32</posX>
<posY>256</posY>
<width>146</width>
<height>234</height>
<visible>no</visible>
<align>center</align>
<texture>-</texture>
</control>

</controls>
</window>


Something I just noticed is that your background image ‘id’ number is the same as my button ‘id’ number
 

robomonkey

Portal Pro
August 4, 2005
207
1
Hi HTPC_for_me, what do the string ID's do?

Ooo, finally I figured out why my date doesn't show, it was aligned to the right!!

Can anyone explain what this control does,
<control>
<type>label</type>
<description>template label for small font</description>
<id>9001</id>
<posX>0</posX>
<posY>0</posY>
<visible>no</visible>
<label>-</label>
<font>font16</font>
<textcolor>ffffffff</textcolor>
</control>

Its marked invisible, and is related to the menu control, but not the date and time as when its removed the menu and hover icons disappear.

Lastly do you have to order the XML file in the order you want it painted on screen i.e.
Background
Logos
Text\Menus

Edit
Also, what does

</control>-->

Specifically the --> at the end?
 

Mr.Mitchell

Retired Team Member
  • Premium Supporter
  • May 13, 2004
    227
    0
    the Netherlands
    robomonkey said:
    Hi HTPC_for_me, what do the string ID's do?
    The texts in MP are identified by an ID (number). You can find these numbers in the strings.xml file for each language. If ypu put an ID in the <label> tag then the text that belongs to that ID will be shown. So if you use ID 11 it will show Monday when you are using English.

    Can anyone explain what this control does,
    <control>
    <type>label</type>
    <description>template label for small font</description>
    <id>9001</id>
    <posX>0</posX>
    <posY>0</posY>
    <visible>no</visible>
    <label>-</label>
    <font>font16</font>
    <textcolor>ffffffff</textcolor>
    </control>

    Its marked invisible, and is related to the menu control, but not the date and time as when its removed the menu and hover icons disappear.
    The label control normally just shows text. However in this case the control is used as a template for controls that are generated by code. If I am not mistaken this defines the look for the texts that are shown on the buttons. To see if I am right you can replace the font by a bigger one and see what changes.

    You can not define the looks for all buttons in the scroll thingy on the home screen since you don't know how many buttons are enabled and what plugins are installed. So the code takes an existing control as a template. And the control is normally hidden because you don't want to see your template on the home screen.

    Lastly do you have to order the XML file in the order you want it painted on screen i.e.
    Background
    Logos
    Text\Menus
    I think so, just test it to be sure.

    Also, what does

    </control>-->

    Specifically the --> at the end?
    --> is the end of a comment. If you put something between then it will be treated as a comment (so it will not be parsed).
     

    robomonkey

    Portal Pro
    August 4, 2005
    207
    1
    Mr Mitchell, thankyou very much, Its made things a lot clearer, is there also a list of button functions like strings.xml?
     

    Users who are viewing this thread

    Top Bottom