9 slice graphic / quad option

hi, I would like to scale an irregular shape, while the edge areas should remain unscaled. Is that possible? svg?

hei mindthegap,

can you try to rephrase that? i am not sure we understand what you mean…

your right, sometime I am fixed in my universe… its a concept for scaling image in flash, starling, unity and some more apps. you define a 3x3 grid, only the middle parts are scaled, the corners are fixed.

that’s bit of puzlling stuff i must admit, but i think i know how to sort it out…
Still can’t figure out if that possible without a plug… So if you think about it in terms of lines:

you can quite clearly see exactly which segments you have to increase

Then it will be time for me to start …

i started writing a dx11 plugin for it some time ago, but ditched it at a point where absolutley nothing was working…
i believe that a plugin would be the way to go though…
would be great to have it for all kinds of button designs and stuff!

i think that the lower part and upper part only scale horizontally, while left and right only scale vertically in order to keep things like drop shadows neat!

test.zip (7.8 KB)
here, first test, is’t spreaded and could use nice naming

project file VVVV.DX11.ANT.zip (47.4 KB)

I have only created dynamic plugins, where there is a tutorial for a VS setup…

You can add like or comment to show how this workshop is important to make it pass ;)

Anyway can do a video, if you want after ;)

unfortunately there is no video tutorial for you, but here is what it might advise, if it existed:

  1. install a recent VS Studio Community

  2. doubleclick the sln-file. If that has not been generated yet, doubleclick the csproj instead.

  3. try to compile it for a supported architecture.


    For existing packs, this may force nuget-retrieval of dependencies.

  4. Add more Dependencies.

    In general, try to get your dependencies from nuget, because that is the way it is done nowadays. In case you cannot, for whatever reason, you can add them from disc as well. If you do, try to get familiar with the csproj xml structure, because you will need manual changes at one point (sorry to tell you).

  5. start up vvvv, add your new plugin, and try to attach the Visual Studio Debugger (Ctrl+Alt+P) to vvvv.exe, and set a breakpoint somewhere in the Evaluate(), and watch vvvv stall and how you can now inspect all data contained within your plugin

Of course that is only the start of the rabbit hole, that is pack development
make sure to close vvvv everytime you recompile

nice challenge. wasn’t easy to get the transformations right, but here is a vvvv/vl only solution. first a normal quad area is sliced into 9 rectangles and texture transformations are calculated from them. then the rectangles get their special scaling and quad transformations are retrieved from the scaled rects. spreading is automatically handled by the VL wrapper node:

the file contains a vvvv module with help patch:

9 slice scaling.zip (30.1 KB)

3 Likes

Crazy, thank you all very much for this! Its nice to see the possibilities.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.