# Tilemap extension for the OLED screen

**URL:** <https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177>\
**Category:** micro:bit\
**Tags:** game, graphics-and-math, make, extension\
**Created:** [October 9, 2023, 7:07pm UTC](https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177 "2023-10-09T19:07:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![urassari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/urassari/32/9535_2.png) [@urassari](https://forum.makecode.com/u/urassari)\
**Post date:** [October 9, 2023, 7:07pm UTC](https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177/1 "2023-10-09T19:07:52Z")

</div>

here is the extension:

> **[GitHub - urassari/pxt-oled-tilemap: an extension for making tilemaps for the...](https://github.com/urassari/pxt-oled-tilemap/)**
>
> an extension for making tilemaps for the oled screen on the micro:bit. (props to MKleinSB for the oled extension, everthing else made by me) - GitHub - urassari/pxt-oled-tilemap: an extension for m...

(props to @MKleinSB for the oled extension)  
(i changed it a little, adding diffrent dimensions of images, and making the draw function have a black background instead of a transparent one)

ill explain the blocks later.

(its very confusing to understand on your own, so i suggest that you should not use it until i explain how it works)

---

<div class="post-metadata">

**Author:** ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)\
**Post date:** [October 9, 2023, 10:02pm UTC](https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177/2 "2023-10-09T22:02:50Z")

</div>

Why does it need to be a different thing for OLED?

---

<div class="post-metadata">

**Author:** ![urassari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/urassari/32/9535_2.png) [@urassari](https://forum.makecode.com/u/urassari)\
**Post date:** [October 10, 2023, 4:43pm UTC](https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177/3 "2023-10-10T16:43:23Z")

</div>

wdym?

---

<div class="post-metadata">

**Author:** ![EpicKitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/epickitty/32/8358_2.png) [@EpicKitty](https://forum.makecode.com/u/EpicKitty)\
**Post date:** [October 10, 2023, 4:45pm UTC](https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177/4 "2023-10-10T16:45:22Z")

</div>

The micro:bit doesn’t have a graphical screen, but a grid of LEDs, and you can’t really show a tile map on it so those blocks aren’t added. But you can add a screen onto the micro:bit, and I think the extensions allows you to make tile maps for the applied screen. Not sure why it’s specifically for OLEDs though.

---

<div class="post-metadata">

**Author:** ![urassari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/urassari/32/9535_2.png) [@urassari](https://forum.makecode.com/u/urassari)\
**Post date:** [October 12, 2023, 6:46pm UTC](https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177/5 "2023-10-12T18:46:09Z")

</div>

i’m gonna explain the blocks.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/1fba2a4876035d38d75c7fd3275bad16a142ab0a.png) sets the tile images.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/48c373df55d34265dbd77925c33fb33bce5008d0.png)  
these (of course) adds and removes tiles.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/21a60ecc44ae35cee6c3f4ff818a3d541907a0b1.png)  
sets the layout of the tilemap, the tiles are represented by ascii characters. (for example, the first tile is " " (space) and the second is “!” and the third is “\*” and so on.)  
(an example of a layout:

```auto
  *
!!!!!!!!!!!
             !!!
!!!!!!!!!!!!!!!!

```

)

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/d46c24857caac56f117c1dd863ccb64326ef15be.png)  
gets the image for the tile.

(and also, the tile sizes should be 8x8)

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/12efb021dc1fcffd154524cdf516ddb0cd35d975.png)  
gets ascii character from x and y.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/a718b28d00a8aa7fe265025c6f89d6a8ed3eec22.png)  
draws the tilemap on the buffer.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/badef876d271ee7f60176f37675b63b51274e929.png)  
these two are not related to tilemaps. the long one gets two areas and detects if they’re colliding to each other or not. and the short one gets a normal x and y position (which becomes an 8x8 area), and gets a tilemap position, and checks if they collide or not.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/8343b26a804e73b8fcdc0377138de416487be59d.png)  
these set and change the camera position

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/c15bcfffc373bf540840a6d4b501ebc645b9aa18.png)  
this replace the tile (as the an ascii character) at the position.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/6311e81639a523d2f2dec1eabe24aeac94b70eea.png)  
and this, is the same as “get\_tilemap”. (idk why i didnt delete this block.)

and thats all!

---

<div class="post-metadata">

**Author:** ![MKleinSB](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mkleinsb/32/593_2.png) [@MKleinSB](https://forum.makecode.com/u/MKleinSB)\
**Post date:** [October 20, 2023, 9:06pm UTC](https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177/6 "2023-10-20T21:06:29Z")

</div>

Can you post an example?

Thanks for your Work!

Michael

---

<div class="post-metadata">

**Author:** ![urassari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/urassari/32/9535_2.png) [@urassari](https://forum.makecode.com/u/urassari)\
**Post date:** [October 23, 2023, 4:36pm UTC](https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177/7 "2023-10-23T16:36:24Z")

</div>

> **[example](https://makecode.microbit.org/S97120-48623-91779-60725)**
>
> Made with ❤️ in Microsoft MakeCode for micro:bit.

fun fact: i was gonna go for a week or two. and i am actually gonna go for a week or two (by “go”, i mean not be online)

---

<div class="post-metadata">

**Author:** ![justaramdonperson1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/justaramdonperson1/32/23598_2.png) [@justaramdonperson1](https://forum.makecode.com/u/justaramdonperson1)\
**Post date:** [September 15, 2025, 5:16pm UTC](https://forum.makecode.com/t/tilemap-extension-for-the-oled-screen/23177/8 "2025-09-15T17:16:11Z")

</div>

uuuuummm… does it work for the micro car oled screen. becouse it not working for me
