godotengine / godotengine/godot
StyleBoxTexture don't support custom texture
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.3.dev3 and 4.2.stable
### System information
Godot v4.3.dev3 - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 () - Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz (12 Threads)
### Issue description
StyleBoxTexture can't use custom texture to render. When it uses custom texture, it renders as all white. Also haven ‘t output anything when use print(), seems don' t call the ProxyTexture2D.draw() method.
The custom ProxyTexture2D script:

The scene:


Only render properly when use custom StyleBox like that:


So, it should make StyleBoxTexture to call Texture.draw() properly?
### Steps to reproduce
1. Write a custom 2d texture script.
2. Make a scene and add a Panel control to the scene.
3. Set the Panel control's "theme overrides/panel" property to a StyleBoxTexture.
4. Set the StyleBoxTexture resource's texture to a custom 2d texture.
5. Run the project, then see the panel render as all white.
### Minimal reproduction project (MRP)
[StyleBoxTextureIssue.zip](https://github.com/godotengine/godot/files/14240495/StyleBoxTextureIssue.zip)
Open the scene and switch the Panel control's "theme overrides/panel" property to different style box resources in "res://resource/style_box/" folder. Run the project to see the result.
Contributor guide
Research direction
Open the attached StyleBoxTextureIssue.zip and reproduce the Panel rendering issue by switching the style box resources in res://resource/style_box/. Start by tracing how StyleBoxTexture handles the custom ProxyTexture2D, then compare it with the custom StyleBox reproduction. Done means a custom 2D texture renders correctly instead of appearing white.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100