totebo
November 4, 2019, 11:42am
1
Is repeating bitmaps in a GUI possible?
Just writing to confirm, really. I found these old threads asking for something similar, but there doesn’t seem to be a good solution.
Feature request:
Hey,
Currently, when you apply a texture to a GUI Box or a Sprite (displayed inside a collection object), the only option for said texture is to have it stretch to fill the object. For generic use, this is fine, however if you wish to have a repeating texture (say for example, a plane of grass), it becomes less than a simple task.
The two options available right now are:
a) Clone the tile a lot of times; this creates obvious needless overhead especially when it’s for something generic such as…
Repeated texture for sprites:
Yes, this is possible. Maybe someone else has a more elegant way of doing it.
You want to have an atlas per tiled texture you want to use. The important thing is that there is no gap around the tiled texture which means nothing else can be on it and it must be a power of 2.
[2019-04-13%2009_20_40-Window]
Then you want a sprite material with wrap mode repeat.
[2019-04-13%2009_13_28-Window]
Inside this shader you can have code such as
varying mediump vec2 var_texcoord0;
uniform lowp sampl…
2 Likes
britzl
November 4, 2019, 9:44pm
2
I can’t really think of a way to achieve this. We would have to add some kind of repeat mode or similar per node.
1 Like
I think I this elsewhere, but this is something I would like, since my UI designer does this (based on what looks good, not POT). Even better, with a 9-slice, and repeat the middle.
2 Likes
totebo
March 24, 2024, 4:08pm
4
I needed this again and found this Github issue for reference:
opened 01:34PM - 12 Dec 20 UTC
feature request
gui

Tiled mode for Slice-9 that repeats the texture if a node greater than a texture and cut off it if the node less than a texture. Something like a toggle option named "Tiled" in the slice-9 section settings.
There is a [topic](https://forum.defold.com/t/a-tiled-slice-9-mode-in-gui-nodes/63921/2) on the forum.
1 Like
Pkeod
May 9, 2024, 12:27pm
5
Still needed. It is painful to have repeating patterns in GUI elements. The most convenient option is to bake the pattern into a large pattern which is very wasteful in GPU and disk.
There are so many repeating pattern use cases.