Giter Site home page Giter Site logo

Comments (3)

KoBeWi avatar KoBeWi commented on August 15, 2024 1

Sub-Region Rect defines what part of the texture you want to use. Unless you want to use only part of the texture, it should be set to the default value of 0, which means whole texture.

The only properties relevant for 9 Patch are the Texture Margins.

from godot.

JoshuaSteward1193 avatar JoshuaSteward1193 commented on August 15, 2024

Right, that is what I suspected the intended behavior might be, but I do feel like the editor might could be a little clearer when it comes to communicating that to the user. None of the field seem to have anything to do with 9-Patch textures at first glance

from godot.

liqites avatar liqites commented on August 15, 2024

@JoshuaSteward1193 I might suffered the same problem, recently I download kenney UI which contains a 48 x 48 border texture, so I want to apply the border to a custom theme of Button. this is my solution finally solve the nine patch problem.

  1. Create a new theme
  2. Create a new Button Type
  3. Create a new normal StyleBoxTexture
  4. Edit StyleBoxTexture
  5. In StyleBoxTexture inspector, drag texture into the texture property
  6. set Texture Margins property to left: 16px; top 16px; right: 16px; bottom: 16px

why 16px ? since my texture size is 48 x 48 ,and it's a ninepatch texture which means should be 3 x 3 blcok. so 48 / 3 is 16px and it behaves as what I expected
panel-000
.I will upload the border texture here.

from godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.