# GUI building and layering graphics - help!



## Maestro77 (Jul 4, 2012)

Greetings scripters. I'm a designer/composer and new to this portion of VI. I've been dabbling in designing Kontakt GUI's for a few clients and would like to know more about how they're created, compiled, layered, etc. What are the rules? What can and can't I do in my designs? I've searched online for some kind of instructional book, tutorial, etc. and no luck. Would love to learn more about the back end so I can design accordingly.

Here's a more specific question: I have a background image, a knob, and a third layer of a subtle lighting effect to go on top of the knob. Is this possible? Can it be programmed to allow control of the knob with a graphic layer on top of it or does the knob need to be at "top" level?

Thanks! You guys are just crazy with your scripting brains. Blows me away.


----------



## Raptor4 (Jul 4, 2012)

Hi,
You can use multi image layering. To my remembrance the knob must be at "top" level. The "top" level in the script is the "last" one declared.


----------



## Big Bob (Jul 4, 2012)

Hi Maestro,

The declaration order only determines the Z order for controls of the same kind.

The controls have a rather complex Z order assigned to them by NI and we have no control over that. Labels are very low on the Z-order totem pole.

So, if you want to overlay a knob, you will have to use a control that has an inherently higher Z. For example, a button has one of the highest Zs, so you could re-skin a button and it could overlay a knob. And, if you use a gray alpha channel you can make it so the knob shows through.

However, since only active controls can be used to 'overlay' a knob, the problem will be that you won't be able to control the knob anymore. For example if you cover a knob with a transparent resized button (to cover the knob completely), when you click on what you think is the knob, the button will respond, not the knob.

So, I don't think there is a way to do what you are asking for but maybe someone else has a way that they can suggest.

Rejoice,

Bob


----------



## mk282 (Jul 5, 2012)

My suggestion would be merging the lighting effect within the knob graphic itself. Less complication overall.


----------



## Maestro77 (Jul 5, 2012)

Thanks everyone. I can easily just apply the lighting effect to all states of the knob in question. Just wondered if there was an easier way to lay that effect over the whole interface at the end. Apparently not, so I'll work with that in mind. Cheers.


----------



## argitoth (Jun 14, 2013)

Searched this thread for help on Z-order.

So is there any way to get a ui_label on top of a ui_slider? I just tried it and right now the label is being covered by the slider. My goal is to have the parameter value displayed on top of the slider. :(


----------



## mk282 (Jun 14, 2013)

No can do.


----------



## ScoringFilm (Jun 14, 2013)

The Z order is:

ui_menu 
ui_button 
ui_switch 
ui_slider 
ui_table
ui_knob 
ui_value_edit 
ui_label
ui_waveform

There are however some odd situations when this doesn't quite work (even the font can make a difference).

Justin


----------



## mk282 (Jun 14, 2013)

Gotta add ui_level_meter, ui_text_edit and ui_file_selector to that list. :D


----------



## tcollins (Jun 14, 2013)

You should be able to have the background, the knob, your shading effect, and a transparent knob of the same dimensions on the top. Then just make the transparent knob control the underlying knob.

on_init
declare ui_slider $real_knob 
declare ui_label $shading
declare ui_slider $my_transparent_knob
end on

on ui_control ($my_tranparent_knob)
$real_knob := $my_transparent_knob
end on

Really, you should probably use ui-slider instead of a knob if you're using your own knob animation, although I can't remember why at this moment.


----------



## mk282 (Jun 15, 2013)

It could be done with just a knob and a label - knob being a knob and label being shading effect.


----------

