# Change wallpaper in KSP ?



## Fredeke (Nov 20, 2019)

Hi again.

I'd like to toggle between different wallpapers in my instrument. However, when I do this:

```
set_control_par_str ($INST_WALLPAPER_ID, $CONTROL_PAR_PICTURE, "bg1")
```
and then, later on, this:

```
set_control_par_str ($INST_WALLPAPER_ID, $CONTROL_PAR_PICTURE, "bg2")
```
Kontakt doesn't change the wallpaper. Even if I replace "bg1" with "bg2" in the first instance, I need to reload (not just reinitialize) the instrument again, for the change to occur.

I vaguely remember a discussion about this... The solution, if I remember well, was to provide one sole picture containing all wallpapers stitched together, and then apply offset to reveal each part. If that is right, then how do I apply the offset? I don't find it in the doc.

(Still using version 5.7 btw)

Thanks.


----------



## henrik242 (Nov 20, 2019)

What I usually do is to assign just a single wallpaper, and then include a number of animations in the image file. So, effectively when changing wallpaper, you just "scroll" to the desired animation within the same file with set_skin_offset(242)


----------



## P.N. (Nov 20, 2019)

Yes, then you can link your offset to each respective tab by multiplying the offset (which is your wallpaper size per tab) with the index.

For a total wallpaper size of 500 px (68 header + 432 workable area), you'd use:

Offset 0 for tab 0; offset 500 for tab 1. offset 1000 for tab 2, etc.

If you run into issues, remember that the top Kontakt header of 68 pixels must be considered, so your offset must be the UI height plus 68 in order for it to lign up properly.


----------



## Fredeke (Nov 20, 2019)

Would that mean that the ui_controls would need to be offset too (instead of being $HIDE_WHOLE_CONTROLed and $HIDE_PART_NOTHINGed) ? Or is only the wallpaper "scrolled" ?


----------



## P.N. (Nov 20, 2019)

Only the wallpaper is scrolled.
You still need to use the hide commands for the controls, but look into the new ui_panel in K6 as it will make your life a lot easier.


----------



## Fredeke (Nov 20, 2019)

Yeah, I guess I'll start developing for K6 after this project. I can't wait to load a wavetable synth with all the grit I can squeeze out of my Eurorack !

And yes, hiding and revealing whole panels would save time. (But you know what would really save time ? A freaking decent open language !!!)


----------



## Fredeke (Nov 20, 2019)

Anyway... It's working. 
Thanks guys!


----------



## Luzifer99 (Nov 28, 2020)

The question I have is, when I open a separate image in addition to the wallpaper in the kontakt, the knob I left in the kontakt is visible above the opened image, can you tell me a way to get rid of that knob?


----------



## Fredeke (Nov 29, 2020)

Luzifer99 said:


> The question I have is, when I open a separate image in addition to the wallpaper in the kontakt, the knob I left in the kontakt is visible above the opened image, can you tell me a way to get rid of that knob?


If you're scripting for Kontakt 6, they have something called "panels" (or some word like that - I haven't scripted in a while) regrouping as many UI elements I you want, and you can toggle whole panels at once. I don't know whether a wallpaper can be part of a panel or if it must still be dealt with separately, though.

In the older versions (5.x), you have to show/hide each UI element individually, in addition to dealing with the background image, using properties $HIDE_WHOLE_CONTROL and $HIDE_PART_NOTHING (this one hides "no part of the control", meaning that it displays it). It's a pain. I know.


----------



## Calg545 (May 16, 2021)

Hi all, I've recently started making my own instruments, I have no skill in coding but through tutorials and discussions like these I'm getting by. So I thought you could code a diff wallpaper for each slot but you can't, I tried to use the Manual for the skin of set but my knowledge is limited and unsure how to add this in as code as it keeps coming up red. I get that I need to create a wallpaper double in px height and then to of set the slots that require it but can someone give me some further guidance on how to code it in, thank you.


----------



## geronimo (May 16, 2021)

This site seems to me to be well documented.









KSP Scripting (Kontakt) :: Custom UI: Background Image / Wallpaper


The instruments background image is called "wallpaper". Its' the basic background texture where all UI elements (knobs, buttons etc) get layered on top. Just to give you an example: we could take our default graphic software and design a realistic synth surface wallpaper (png file ...




blog.yummybeats.com





For a different wallpaper for many slot, use the code: set_skin_offset _
And provide a higher image in order to chain, end to end each desired image and it is enough to declare in pixel, with the code above.
Because , you must have only one picture for the wallpaper: this picture must include each part that you want to appear by tab; and then you shift with: set_skin_offset (pixel value).
Sory for my bad english _


----------



## Calg545 (May 17, 2021)

Hi, no that totally makes sense, I tried that yesterday and it didn't work, but it must be right so there must have been something else I've not done wrong, I'll give it another go today. Really appreciate it, thank you.


----------



## geronimo (May 17, 2021)

Did you use "set_skin_offset" for each script text and anticipate the height of the image constituting the wallpaper?
Don't forget also the upper banner of KONTAKT information corresponding in general to a height of 68 pixels as well as the space taken in height of the script tabs. Everything has to be anticipated and it shows on getting there, on the content is good.
What you must remember: the script shifts up and down the big picture constituted by the wallpaper and displays only a certain part of this picture .


----------



## Calg545 (May 17, 2021)

Hey so that worked amazing unsure what i did wrong but clearly it was simple lol. Can I ask as well, Im using Canva cos its free and I can create templates and it has predefined text which allows me to create ideas quickly (Theres also a free plan on Adobe spark to). I have GIMP but far too complicated for me as current, what do people use to create wallpapers for Kontakt which has predefined templates to speed the process up, just wondering if theres anything better than canva/adobe


----------



## Calg545 (May 17, 2021)

Yeah I've got three pages working, its a lot of back and forth alining the text and thats only the headings not the sub headings lol, worked by "set_skin_offset" . I've created a simple instrument for someone before but im doing this for myself so want to push the skills now to make it all singing and dancing lol


----------

