KONTAKT 4 - Text extend beyond a ui_label limit
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
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
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.
- KVRAF
- 23112 posts since 7 Jan, 2009 from Croatia
Change the width of the label by using $CONTROL_PAR_WIDTH.
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
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.
- KVRAF
- 23112 posts since 7 Jan, 2009 from Croatia
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.
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
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.
- KVRAF
- 23112 posts since 7 Jan, 2009 from Croatia
No, you don't need to do that. Just make the label wider than 20 px. Try 100, for example. Try 200. Simples.
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
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):
Something like this (which is the same image edited):
You do not have the required permissions to view the files attached to this post.
- KVRAF
- 23112 posts since 7 Jan, 2009 from Croatia
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
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
Yeah, that is what I wanted to know. Thanks EvilDragon.