# Tiling sprite texture

**URL:** <https://forum.defold.com/t/tiling-sprite-texture/1688>\
**Category:** Feature requests (USE GITHUB)\
**Created:** [April 26, 2016, 2:22pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688 "2016-04-26T14:22:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [April 26, 2016, 2:22pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/1 "2016-04-26T14:22:38Z")

</div>

A kind of sprite that can be resized and when it does its texture is tiled within it without actually stretching the texture - although a property which resizes the texture within it to be larger or smaller would be handy too + ability to change dimensions of the sprite with scripting while not changing the tiling offset. Meant to be used with textures that are made to tile seamlessly. Can be useful with layouts, making level.

---

<div class="post-metadata">

**Author:** ![sicher](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sicher/32/8_2.png) [@sicher](https://forum.defold.com/u/sicher)\
**Post date:** [April 27, 2016, 2:06pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/2 "2016-04-27T14:06:08Z")

</div>

You can do that with a custom material and the right sampler setting. Check out [Defold materials manual](http://www.defold.com/manuals/material/#_sampler_settings)

You won’t get editor feedback through which may be what you’re after?

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [April 27, 2016, 2:24pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/3 "2016-04-27T14:24:20Z")

</div>

Yes, to see it in the editor.

---

<div class="post-metadata">

**Author:** ![KingCosmic](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/kingcosmic/32/20297_2.png) [@KingCosmic](https://forum.defold.com/u/KingCosmic)\
**Post date:** [May 20, 2020, 4:07pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/4 "2020-05-20T16:07:08Z")

</div>

I apologize for the bump, but if this is still the way to achieve a tilesprite is there an example somewhere of this custom material and how to use it

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [May 20, 2020, 4:31pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/5 "2020-05-20T16:31:17Z")

</div>

> [@Repeating texture?](https://forum.defold.com/t/repeating-texture/49201/2):
>
> 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 sampler…

I still think the tiling texture would be a useful primitive type to compliment normal sprites / gui nodes.

---

<div class="post-metadata">

**Author:** ![o3bla](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/o3bla/32/29331_2.png) [@o3bla](https://forum.defold.com/u/o3bla)\
**Post date:** [February 12, 2023, 11:33pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/6 "2023-02-12T23:33:07Z")

</div>

No update for this request ☹ ?

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [February 13, 2023, 7:56am UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/7 "2023-02-13T07:56:25Z")

</div>

Yes and no, we have started working on custom vertex formats which should help with accessing specific per-sprite data in a shader while not breaking batching. To implement the effect you need to know the size of the texture a sprite is using, and there’s certainly several ways of achieving it currently depending on your needs.

---

<div class="post-metadata">

**Author:** ![o3bla](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/o3bla/32/29331_2.png) [@o3bla](https://forum.defold.com/u/o3bla)\
**Post date:** [March 7, 2024, 8:26pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/8 "2024-03-07T20:26:33Z")

</div>

Hi, after one year 🤣, there’s no update? 😢

---

<div class="post-metadata">

**Author:** ![roccosaienz](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/roccosaienz/32/19991_2.png) [@roccosaienz](https://forum.defold.com/u/roccosaienz)\
**Post date:** [March 7, 2024, 8:32pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/9 "2024-03-07T20:32:40Z")

</div>

I would say this is the last beta release, if I understand correctly. Clearly @jhonny.goransson may confirm this.

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [March 7, 2024, 9:21pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/10 "2024-03-07T21:21:03Z")

</div>

Yes you can put whatever data you need into vertex attributes, including texture or atlas region sizes.

---

<div class="post-metadata">

**Author:** ![o3bla](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/o3bla/32/29331_2.png) [@o3bla](https://forum.defold.com/u/o3bla)\
**Post date:** [March 8, 2024, 8:50am UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/11 "2024-03-08T08:50:54Z")

</div>

Sorry, what do you mean? Have I to follow the same steps to make tiled sprites? There’s no builtin GUI system like a flag or configuration to activate this? ☹

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [March 8, 2024, 10:20am UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/12 "2024-03-08T10:20:15Z")

</div>

Here’s the manual entry for attributes:

> **[Attributes - Defold materials manual](https://defold.com/manuals/material/#attributes)**
>
> Materials are used to express how a graphical component (a sprite, tilemap, font, GUI node, model etc) should be rendered. | This manual explains how to work with materials, shader constants and samplers.

In the last beta we added functionality to write attribute data via go.set (and get it via go.get) so it could used to implement tiling.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 8, 2024, 1:16pm UTC](https://forum.defold.com/t/tiling-sprite-texture/1688/13 "2024-03-08T13:16:21Z")

</div>

> [@o3bla](#):
>
> There’s no builtin GUI system like a flag or configuration to activate this

Correct. There is no automated way of doing this (yet). It might be something we add at some point. Or maybe a material that does this for you (not sure if it is possible).
