Jump to content

Widget Material


SpiderPig
 Share

Recommended Posts

I'm just going to throw this out there - I wonder if we should be able to change a widgets material?

For example if I assign the below image to a large panel the image would stretch.  However the corners of the image (red dots) should maintain their aspect ratio as defined by the green grid.  The other 5 regions of the image can be stretched to fill in the regions between the corners.  I've been experimenting with custom widgets and can separate the regions into their individual pixmap's and assign them to their own block to get the desired effect, some effects may need lots of blocks though.  But a custom shader that does this would be better I think.  Thoughts?

TestBorderImage.png.d322b27a6d1215bd205df45eae7f2ebb.png

I can think of a few others cases where this might be useful.  Glow effects, animated textures, etc.

Link to comment
Share on other sites

I like the idea, but i doubt this will be done, as it would be ingame only. The native gui interface relies on the native drawing methods provided by the os. This is why can't use the texture block when you add an interface to a window. 

An alternative would be some kind of tiled pixmap block for this purpose, with that you can define the margins needed and the block itself creates this kind of behaviour. but it would be hard to animate (at least performance wise) as we can't use 3d textures.

I have an idea which i will try tomorrow :)

  • Like 1
  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

The only thing it can't do right now is a tiled center, assuming the middle image isn't just a solid color as in the picture above. Some tiling widget block options would handle that if they were added.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

10 hours ago, klepto2 said:

I like the idea, but i doubt this will be done, as it would be ingame only. The native gui interface relies on the native drawing methods provided by the os. This is why can't use the texture block when you add an interface to a window. 

Ah of course.  I didn't think about that.  I was toying with the idea of making my own widget system using sprites so that I could do this because all of my widgets are going to have textures anyway.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...