PDA

View Full Version : Buttonscroller question/problem...


Livin
2005-06-22, 10:02
i currently use the pm3 skin with a mod to use a buttons scroller. i'd like to add an animated gif at the front (left side) of the menu but it seems that i'm need to make the animated button the entire size of the scroller?

can i just put an image at the front onverlaying the current background and use something like a <visible> tag using some sort of .hasfocus (maybe this is a feature request)?

or do i have the code incorrect in my buttons scroller?

the gif i want to use is only 34x38
the code below stretches the gif to the size of the scroller and does not keep the aspect ratio.

current code...
<!-- button scroller -->
* * * *<controlgroup>
* * * * * <control>
* * * * * * * <description>home buttons</description>
* * * * * * * <type>buttonscroller</type>
* * * * * * * <id>300</id>
* * * * * * * <posx>80</posx>
* * * * * * * <posy>222</posy>
* * * * * * * <width>256</width>
* * * * * * * <height>33</height>
* * * * * * * <buttongap>6</buttongap>
* * * * * * * <numbuttons>5</numbuttons>
* * * * * * * <orientation>vertical</orientation>
* * * * * * * <align>left</align>
* * * * * * * <aligny>center</aligny>
* * * * * * * <movement>0</movement>
* * * * * * * <defaultbutton>3</defaultbutton>
* * * * * * * <alpha>0</alpha>
* * * * * * * <wraparound>yes</wraparound>
* * * * * * * <smoothscrolling>no</smoothscrolling>
* * * * * * * <font>special13</font>
* * * * * * * <onleft>9</onleft>
* * * * * * * <onright>9</onright>
* * * * * * * <onup>300</onup>
* * * * * * * <ondown>300</ondown>
* * * * * * * <textoffsetx>40</textoffsetx>
* * * * * * * <texturefocus>home_focus.gif</texturefocus>
* * * * * * * <texturenofocus>-</texturenofocus>
* * * * * * * <textcolor>ffffffff</textcolor>
* * * * * </control>
* * * </controlgroup>


thanks for the help!

KoTiX
2005-06-22, 17:57
you need to make a gif wider, like 180x38, where all the right side is transparent and your 34x38 texture is only on left side.

Livin
2005-06-22, 19:59
i think i found a bug...

i tried using two different animated gifs with transparent areas (one below) and they both crash xbmc's gui. i get only a blank/black screen. xbmc will no longer allow ftp either.

http://members.cox.net/affini/homefocus.gif

here's the home.xml code i use...
<!-- button scroller -->
<controlgroup>
<control>
<description>home buttons</description>
<type>buttonscroller</type>
<id>300</id>
<posx>80</posx>
<posy>222</posy>
<width>256</width>
<height>33</height>
<buttongap>6</buttongap>
<numbuttons>5</numbuttons>
<orientation>vertical</orientation>
<align>left</align>
<aligny>center</aligny>
<movement>0</movement>
<defaultbutton>3</defaultbutton>
<alpha>0</alpha>
<wraparound>yes</wraparound>
<smoothscrolling>no</smoothscrolling>
<font>special13</font>
<onleft>9</onleft>
<onright>9</onright>
<onup>300</onup>
<ondown>300</ondown>
<textoffsetx>40</textoffsetx>
<texturefocus>homefocus.gif</texturefocus>
<texturenofocus>-</texturenofocus>
<textcolor>ffffffff</textcolor>
</control>
</controlgroup>

KoTiX
2005-06-23, 09:19
be sure you set the frame deleting method of the gif to "restore to background" or you'll have trouble using gifs.
i normally creaty gif with different programs but before to use it in xbmc i always open it with "adobe imageready" set the "restore to background" thing and i "save optimized" the gif. in this way i'm sure i don't have any sort of problem.

the code look fine to me, if you like you can check up my home.xml in the orbs skin, it should be very similar.

Livin
2005-06-23, 09:38
i made the gif using the latest version of imageready, cs2

i found the "restore to background" setting you mentioned.

that fixed the issue. thanks!!!

i have a feeling there is some bug in xbmc that does not know how to handle that type of gif properly or an error trapping bug.

jmarshall
2005-06-24, 13:47
affini: was this with the gif above? if so i'll take a look when i get a spare minute or two.

Chokemaniac
2005-06-24, 16:33
i think the scroller can only render text on the bttuon texture and not next to it. thats why kotix said you have to make it wider...

maybe you can sort this out jonatan ;)

KoTiX
2005-06-24, 17:34
for what i know the "restore to background" issue with animated gifs is present since the beginning of xbmc, or at least since the skinning contest.
regarding button scroller chokey is right, the text is rendered within the size of the button, so if we are using a 25x25 button it will render just 1 or 2 letters, to see the complete string we need a wider button eg. 180x25

Livin
2005-06-24, 18:47
the code i'm using works (ie, text is rendered on-top of the image).

the gif (in above post) definitely causes a gui crash, at minimum, if you do not use "restore to background" for the frame delete method in the animation. i personally have no idea what that means but if it is not used... crashola! ;)