Kodi Community Forum

Full Version: Create screen overlay with png?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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!
i know what you want to overlay dl my hacked skin its in there with all correct values to center it.
if you are talking about carbon, i tried dling it from xbox-skins and it is corrupt. Sad

can you attach the code to this thread for me?

thanks!!!
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
if you want ill send you xmls for help.png let me know if you worked it out ok Smile as described
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!!!
you can just create the texture now on button over and set new fade in and out tag to off Smile cheers to jmarshal again
bp,
i have no idea what you mean... can you post the xml for me please?

thanks
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>
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



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
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
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
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.
try changing this line:

<execute>xbmc.restartapp()</execute>
Pages: 1 2