Stretch mode ‘tile’ not working - still appears stretched.
I can’t reproduce the issue on my end, and I don’t see anything misconfigured (not that the Inspector settings are all that complicated for this, lol). Additionally, a search for this didn’t turn up anything conclusive that’s still outstanding. You may want to try setting CanvasItem–>Texture–>Repeat to Enabled, although it didn’t have any impact when I tried this.
I assume you’re using Godot 4.2.1 or 4.2.2, right? Especially this early in the course, I can’t see a reason why this wouldn’t work properly. We can go the Sprite2D route Kaan mentions in the lecture though - this should get you the same end result:
- Replace the TextureRect with a Sprite2D node
- Drag the purple texture resource into the Texture field of the Sprite2D’s Inspector
- In the Sprite2D’s Inspector:
- Set CanvasItem–>Texture–>Repeat to Enabled
- Tick Sprite2D–>Region–>Enabled
- EDIT: set w and h not to the project’s window size, but to [multiples of the texture’s dimensions] that meet or exceed the project’s window size. For example, the Godot icon is 128x128, so to fit the 1152x648 project window, you would need to set w to 1152 and h to 768. They would have to be multiples of the texture’s dimensions because otherwise the tiles will not be in scale. You’ll have to check the texture’s dimensions yourself as I don’t have the project handy at the moment.
- Reposition the Sprite2D if necessary
Redoing the node fixed the issue somehow. I think that it matters which tool that you use to stretch the node in the scene.
Yes, 4.2.2.
That’s certainly a possibility! I tend to stick with the ordinary cursor mode until I need to do something more specific, so I’ll keep this in mind. Glad you got things working =)
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.