KONTAKT 4 - Text extend beyond a ui_label limit

VST, AU, AAX, CLAP, etc. Plugin Virtual Instruments Discussion
Locked New Topic
RELATED
PRODUCTS
Kontakt

Post

Hi

When I retrieve the name of a group for being shown on a label, it's so long that extends a bit of the ui_ label. How can be that fixed?

Cheers
Last edited by hellishvictor on Wed Mar 27, 2019 6:10 pm, edited 1 time in total.

Post

Change the width of the label by using $CONTROL_PAR_WIDTH.

Post

Doesn't work here, not even change the size of the label.

Code: Select all

on init
	make_perfview

	declare ui_label $group (1,1)
		set_control_par(get_ui_id($group),$CONTROL_PAR_WIDTH,20)
		set_text($group,"#49. " & group_name(49))
		move_control($group, 1,1)
	message("")
end on
You do not have the required permissions to view the files attached to this post.

Post

When you change the width, you also need to set the position of the control in pixels, not grid units (use move_control_px()). Also default width for the label is 85 px, so you actually made the label smaller there, but as soon as you used move_control to move it to (1, 1) grid unit, it reverted the width to default size.

Post

Ok, but still the text gets outside the label. I guess I'll have to create a second label with the size desired for the text, and leave the first one with the text without background

Code: Select all

on init
	make_perfview

	declare ui_label $group (1,1)
		set_control_par(get_ui_id($group),$CONTROL_PAR_WIDTH,20)
		set_text($group,"#49. " & group_name(49))
		set_control_par(get_ui_id($group),$CONTROL_PAR_POS_X,100)
	message("")
end on
You do not have the required permissions to view the files attached to this post.

Post

No, you don't need to do that. Just make the label wider than 20 px. Try 100, for example. Try 200. Simples.

Post

I think you don't get it; see the pictures and see how there always appear one character outside the label; the "v" on the case of the first one and the "9" on the second. I want to make the text gets cut if it exceed the label size, whatever it is. Its not really about the label size, but the text inside it.
Something like this (which is the same image edited):
You do not have the required permissions to view the files attached to this post.

Post

You cannot change that behavior, this is how Kontakt renders text on the label internally. Feel free to hide the label background if it bothers you, though :)

Post

Yeah, that is what I wanted to know. Thanks EvilDragon.

Locked

Return to “Instruments”