e.g Would be convenient for button background
Sorry I forgot to answer this.
It was first suggested and discussed in #17 and unfortunately my stance stands here that it isn't the priority and a naive implementation would have noticeable effect on performances.
When / if we get around to spend time on a new design this might come back for now it seem wiser to drop it.
Note that your buttons are of a known you can use ImageButton(), otherwise if it is just for buttons (and not for every widget) you can fairly easily draw the 9-patch version yourself and implement the button behavior via the helpers in imgui_internal.h
@ocornut I am interested in picking up this ninepatch (.9.png) feature if you are interested to discuss.
I unfortunately don't have much bandwidth to look into this at the moment.
I think it would be preferable to finish #1962 first and make it workable to every edge case (it currently works as a proof of concept but has various issues) then we'll get a better starting base.
Another desirable thing are vertical gradients, which are not super well compatible with nine-patch (if you consider that the point of nine-patch is to colorize your textures). Ninepatch skinning is feasible but I envision getting the proof of concept is 10% of the work and then getting it right in term of resizing flexibility, runtime overhead, configurability, various edge cases such as the restriction it causes on minimum widgets sizes, forward and backward compatibility etc. would become 90% of the work.
If you are interested in this feel free to experiment, you might even find that the 10% version may be enough for you. It'd probably be more productive if you experiment without worrying and we can pick ideas from the result you get.
(Shouldn't it be "eight-patch" ?)
I guess, you have to count the middle patch to make 9 :)
I have implemented 3D Nine patch in our You.i Engine. I'll see if I can get a PoC working in imgui.
Is there anyone that started working on nine patch yet?
If not, I'm going to fire this up.
@richardkogelnig we arent. Go for it :+1:
Yes I'm still very interested in it
Perfect, I'll see how I can work this with no impact to the core imgui.
Hi
I've made a simple 9-slice scale using OpenGL. I'm rendering to a texture (framebuffer) and simply using the OpenGL texture id to display it as an _ImGui::Image_
It's far from perfect, more like a quick and dirty solution, but maybe it can help somebody.
You can find it here.
I'm using ImGui to showcase it, but can be used independently of it.
Sweet! I haven't got around doing this yet, so this will give me a headstart!
Most helpful comment
Is there anyone that started working on nine patch yet?
If not, I'm going to fire this up.