PDA

View Full Version : Create screen overlay with png?


Livin
2005-07-04, 06:04
i have an image i'd like to launch from a button on the home screen.

i'd like it to not be a completely new screen, just a pop-up or overlay on top of the home screen.

can someone give me an example of the control needed?

thanks!

BritneysPAIRS
2005-07-04, 07:09
i know what you want to overlay dl my hacked skin its in there with all correct values to center it.

Livin
2005-07-04, 08:35
if you are talking about carbon, i tried dling it from xbox-skins and it is corrupt. :(

can you attach the code to this thread for me?

thanks!!!

jmarshall
2005-07-04, 09:57
you do this by creating a new dialog window.

create a custom57.xml file (57 just for argument's sake).

at the top, before the <controls> tag, define:

<id>4567</id>
<type>dialog</type>

this is then a popup, modal dialog window. it'll popup when you do an xbmc.activatewindow(4567) from keymap.xml, python, or a button from the home.xml skin etc.

you can the set relative coordinates:

<coordinates>
<type>1</type>
<posx>200</posx>
<posy>100</posy>
</coordinates>

the window will then be positioned at 200,100, and all other control positions will be taken from this location.

then add the controls you want (probably a bunch of buttons, a background image or two etc. etc.) and you're done.

let me know if you need more specifics.

cheers,
jonathan

BritneysPAIRS
2005-07-04, 11:06
if you want ill send you xmls for help.png let me know if you worked it out ok :) as described

Livin
2005-07-04, 21:55
jm,
thank you for explaining. i searched the manual and could not find it.

bp,
sure, if you want to post them i'd love to see the code.


thanks!!!

BritneysPAIRS
2005-07-05, 06:10
you can just create the texture now on button over and set new fade in and out tag to off :) cheers to jmarshal again

Livin
2005-07-05, 06:36
bp,
i have no idea what you mean... can you post the xml for me please?

thanks

KoTiX
2005-07-05, 12:06
as jmarshall said, in home.xml add your button like:

* *<control>
* * *<description>custom button</description>
* * *<type>button</type>
* * *<id>400</id>
* * *<posx>200</posx>
* * *<posy>300</posy>
* * *<label>custom</label>
* * *<texturefocus>custom-fo.png</texturefocus>
* * *<texturenofocus>custom-nf.png</texturenofocus>
* * *<execute>xbmc.activatewindow(4567)execute>
* * *<onleft>310</onleft>
* * *<onright>100</onright>
* * *<onup>99</onup>
* * *<ondown>311</ondown>
* *</control>

create a custom9.xml (9 or whatever you like) like this:

<window>
*<id>4567</id>
*<type>dialog</type>
*<defaultcontrol>1</defaultcontrol>
*<coordinates>
* <system>1</system> *!not sure about this one probably need to use <type>
* <posx>50</posx>
* <posy>50</posy>
*</coordinates>
*<controls>
* *<control>
* * *<description>custom image</description>
* * *<type>image</type>
* * *<id>1</id>
* * *<posx>15</posx>
* * *<posy>0</posy>
* * *<width>40</width>
* * *<height>40</height>
* * *<texture>custom.png</texture>
* *</control>
*</controls>
</window>

Chokemaniac
2005-07-05, 12:08
what hes trying to say is - you can make a button with the whole screen as focus texture. that way you wouldnt even have to press it to pop this thing up, but just foucus the button.

if you wanna put more stuff on that thing (like more buttons) you want to make a seperate xml like jmarshall told you

make a custom*.xml

give it a window id between 58 and 70

right after the window id define <type>dialog</type>

and then go nutz with your custom, transparent new dialog...


edit: lol kotix beat me by 2 mins - damn coffee :p

BritneysPAIRS
2005-07-05, 12:28
is it for help screen, ill send you both ways if it is grapghics and xmls tommorrow if you email. one has help overlay when you press a other overlays help you when go to button and when you press a it goes to xbmc credits

newsinger
2005-08-01, 17:12
i have tried to construct some ham fisted stuff which works in a fashion and i would appreciate some advice on how it could be improved.
within keypad.xml i have assigned a key to open a custom dialog window - and it does it as needed, however, i havene't figured out how to close it.

the code for the custom window :

<window>
<id>4567</id>
<type>dialog</type>
<visible>player.hasmedia</visible>
<defaultcontrol>1</defaultcontrol>
<coordinates>
<system>1</system>
<posx>50</posx>
<posy>50</posy>
</coordinates>
<controls>
<controlgroup>
<control>
<description>custom image</description>
<visible>player.hasmedia</visible>
<type>image</type>
<id>2</id>
<posx>450</posx>
<posy>0</posy>
<width>170</width>
<height>170</height>
<texture>e:\images\universe_man.jpg</texture>

</control>

<control>
<description>menu button</description>
<visible>player.hasmedia</visible>
<type>button</type>
<id>1</id>
<titlecolor>ffd2ff00</titlecolor>
<headlinecolor>ddced8da</headlinecolor>
<textcolor>ffd2ff00</textcolor>
<label>push</label>
<posx>10</posx>
<posy>470</posy>
<width>30</width>
<height>20</height>
<font>font10</font>
<execute>xbmc.restartapp</execute>
<align>center</align>
<textoffsety>-1</textoffsety>
</control>

<control>
<description>vis window</description>
<type>visualisation</type>
<id>3</id>
<posx>470</posx>
<posy>380</posy>
<width>120</width>
<height>120</height>
</control>

</controlgroup>
</controls>
</window>

thanks

jmarshall
2005-08-01, 18:10
back on the controller (and the remote) will close all dialogs by default.

there's no way currently to specify another key to do it, as keymap.xml cannot be used to setup keys for custom windows.

cheers,
jonathan

newsinger
2005-08-03, 15:01
thanks jm

tried to use the back key to no effect, also had a go at opening the window from the home page, talk about 'hard love' but it was worth it to collect the scars.
i'm about to try out visibility fades to see if that will do the trick, as before any newbie advice to avoid sharp objects would be good.
ultimately i would like to run a slide show within a dialog window - it's just a dream.

Nuka1195
2005-08-03, 16:15
try changing this line:

<execute>xbmc.restartapp()</execute>

newsinger
2005-08-04, 08:59
within the dialog window i would like to display a window the same size as video preview running a slideshow.
if i run a slideshow from this dialog it has interesting effects but not what i was looking for.

Chokemaniac
2005-08-04, 14:36
what exactly are you trying to pull up?

where do you want this slideshow and how do you plan to execute it?

u want like, to have a little slideshow of like 3 different weather pictures when having focus on the home weather button??

newsinger
2005-08-04, 15:34
thats it, and if it can be done within the dialog window.

Chokemaniac
2005-08-05, 12:03
you cant have a real slideshow in a window - but you could try this:

if the my pictures button has id 5, make 3 pictures with the following tags:

<visible fade="10">!player.hasvideo + control.hasfocus(5) | system.idletime(4)</visible>
<visible fade="10">!player.hasvideo + control.hasfocus(5) | system.idletime(2)</visible>
<visible fade="10">!player.hasvideo + control.hasfocus(5)</visible>

i wouldnt suggest to use too many pics tho since they are loaded into memory at ince then - max 5 pics per button

due to the delayed idle times, the pictures will fade in one after another - but only once ofcourse - make sure the topmost picture has the highest idletime set and the bottom one doesnt have any - then it will switch again, as soon as you hit a button after the highest idle time hit

newsinger
2005-08-05, 12:28
thanks for the info i'll give it a go and see what happens.

also thanks to jm, i updated my version of the s/w and the back button works a treat.