Inheritance #

RefCounted

- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
Resource

- Animation
- AnimationLibrary
- AnimationNode (6)
- AnimationNodeStateMachinePlayback
- AnimationNodeStateMachineTransition
- AudioBusLayout
- AudioEffect (17)
- AudioStream (10)
- BitMap
- BoneMap
- ButtonGroup
- CameraAttributes (2)
- ColorPalette
- Compositor
- CompositorEffect
- CryptoKey
- Curve
- Curve2D
- Curve3D
- EditorNode3DGizmoPlugin
- EditorSettings
- Environment
- Font (3)
- GDExtension
- GLTFAccessor
- GLTFAnimation
- GLTFBufferView
- GLTFCamera
- GLTFDocument (1)
- GLTFDocumentExtension (1)
- GLTFLight
- GLTFMesh
- GLTFNode
- GLTFPhysicsBody
- GLTFPhysicsShape
- GLTFSkeleton
- GLTFSkin
- GLTFSpecGloss
- GLTFState (1)
- GLTFTexture
- GLTFTextureSampler
- Gradient
- Image
- ImporterMesh
- InputEvent (6)
- JSON
- LabelSettings
- LightmapGIData
- Material (9)
- Mesh (4)
- MeshLibrary
- MissingResource
- MultiMesh
- NavigationMesh
- NavigationMeshSourceGeometryData2D
- NavigationMeshSourceGeometryData3D
- NavigationPolygon
- Noise (1)
- Occluder3D (5)
- OccluderPolygon2D
- OggPacketSequence
- OpenXRAction
- OpenXRActionMap
- OpenXRActionSet
- OpenXRBindingModifier (2)
- OpenXRHapticBase (1)
- OpenXRIPBinding
- OpenXRInteractionProfile
- PackedDataContainer
- PackedScene
- PhysicsMaterial
- PolygonPathFinder
- RDShaderFile
- RDShaderSPIRV
- RichTextEffect
- SceneReplicationConfig
- Script (3)
- Shader (1)
- ShaderInclude
- Shape2D (8)
- Shape3D (9)
- Shortcut
- SkeletonModification2D (7)
- SkeletonModificationStack2D
- SkeletonProfile (1)
- Skin
- Sky
- SpriteFrames
- StyleBox (4)
- SyntaxHighlighter (2)
- Texture (3)
- Theme
- TileMapPattern
- TileSet
- TileSetSource (2)
- Translation (1)
- VideoStream (1)
- VideoStreamPlayback
- VisualShaderNode (62)
- VoxelGIData
- World2D
- World3D
- X509Certificate
StyleBoxTexture
Table of contents

StyleBoxTexture #

is_refcounted, is_instantiable, resource, core, not_builtin_classes

A texture-based nine-patch StyleBox.

A texture-based nine-patch StyleBox, in a way similar to NinePatchRect. This stylebox performs a 3×3 scaling of a texture, where only the center cell is fully stretched. This makes it possible to design bordered styles regardless of the stylebox's size.

Members #

var axis_stretch_horizontal = AXIS_STRETCH_MODE_STRETCH#

Controls how the stylebox's texture will be stretched or tiled horizontally. See AxisStretchMode for possible values.

var axis_stretch_vertical = AXIS_STRETCH_MODE_STRETCH#

Controls how the stylebox's texture will be stretched or tiled vertically. See AxisStretchMode for possible values.

var draw_center: bool = true#

If true, the nine-patch texture's center tile will be drawn.

var expand_margin_bottom: float = 0.0#

Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.

var expand_margin_left: float = 0.0#

Expands the left margin of this style box when drawing, causing it to be drawn larger than requested.

var expand_margin_right: float = 0.0#

Expands the right margin of this style box when drawing, causing it to be drawn larger than requested.

var expand_margin_top: float = 0.0#

Expands the top margin of this style box when drawing, causing it to be drawn larger than requested.

var modulate_color: Color = Color(1, 1, 1, 1)#

Modulates the color of the texture when this style box is drawn.

var region_rect: Rect2 = Rect2(0, 0, 0, 0)#

The region to use from the texture.

This is equivalent to first wrapping the texture in an AtlasTexture with the same region.

If empty (Rect2(0, 0, 0, 0)), the whole texture is used.

var texture: Texture2D#

The texture to use when drawing this style box.

var texture_margin_bottom: float = 0.0#

Increases the bottom margin of the 3×3 texture box.

A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box.

This is also the value used as fallback for StyleBox.content_margin_bottom if it is negative.

var texture_margin_left: float = 0.0#

Increases the left margin of the 3×3 texture box.

A higher value means more of the source texture is considered to be part of the left border of the 3×3 box.

This is also the value used as fallback for StyleBox.content_margin_left if it is negative.

var texture_margin_right: float = 0.0#

Increases the right margin of the 3×3 texture box.

A higher value means more of the source texture is considered to be part of the right border of the 3×3 box.

This is also the value used as fallback for StyleBox.content_margin_right if it is negative.

var texture_margin_top: float = 0.0#

Increases the top margin of the 3×3 texture box.

A higher value means more of the source texture is considered to be part of the top border of the 3×3 box.

This is also the value used as fallback for StyleBox.content_margin_top if it is negative.

Methods #

const func get_expand_margin(margin: int enumSide) -> float#

Returns the expand margin size of the specified Side.

const func get_texture_margin(margin: int enumSide) -> float#

Returns the margin size of the specified Side.

func set_expand_margin(size: float) -> void#

Sets the expand margin to size pixels for the specified Side.

func set_expand_margin_all(size: float) -> void#

Sets the expand margin to size pixels for all sides.

func set_texture_margin(size: float) -> void#

Sets the margin to size pixels for the specified Side.

func set_texture_margin_all(size: float) -> void#

Sets the margin to size pixels for all sides.

Annotations #

Constants #

const AXIS_STRETCH_MODE_STRETCH = 0 enum AxisStretchMode#

Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly.

const AXIS_STRETCH_MODE_TILE = 1 enum AxisStretchMode#

Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system.

const AXIS_STRETCH_MODE_TILE_FIT = 2 enum AxisStretchMode#

Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike AXIS_STRETCH_MODE_TILE, the texture may be slightly stretched to make the nine-patch texture tile seamlessly.

Constructors #

Enums #

AxisStretchMode#

enum AxisStretchMode { AXIS_STRETCH_MODE_STRETCH = 0, AXIS_STRETCH_MODE_TILE = 1, AXIS_STRETCH_MODE_TILE_FIT = 2, }

Operators #

Signals #

Theme Items #

Tutorials #