# Inventory extension

**URL:** <https://forum.makecode.com/t/inventory-extension/8662>\
**Category:** Show & Tell\
**Tags:** extension\
**Created:** [June 9, 2021, 11:29pm UTC](https://forum.makecode.com/t/inventory-extension/8662 "2021-06-09T23:29:04Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [December 30, 2022, 6:02pm UTC](https://forum.makecode.com/t/inventory-extension/8662/46 "2022-12-30T18:02:13Z")

</div>

The point of this extension is to hide the complexity of drawing an inventory or toolbar! They can be really complicated as a UI component, which is why there are a lot of blocks.

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [February 2, 2023, 6:42am UTC](https://forum.makecode.com/t/inventory-extension/8662/47 "2023-02-02T06:42:25Z")

</div>

yes you can use the toolbar in 3D(2.5D)

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [February 2, 2023, 6:42am UTC](https://forum.makecode.com/t/inventory-extension/8662/48 "2023-02-02T06:42:33Z")

</div>

you use the auto-destroy block in the sprites section and click on the auto-destroy if you scroll down there’ll be a relative to camera option.

---

<div class="post-metadata">

**Author:** ![jnegative](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jnegative/32/10173_2.png) [@jnegative](https://forum.makecode.com/u/jnegative)\
**Post date:** [July 24, 2023, 9:23pm UTC](https://forum.makecode.com/t/inventory-extension/8662/49 "2023-07-24T21:23:33Z")

</div>

I’m working on a multiplayer game (using riknoll’s split-screen extension), and I need players to be able to access their own inventories. Would it be possible to add a block to set the inventory’s dimensions?  
Thanks, all your work is amazing!

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [July 24, 2023, 11:48pm UTC](https://forum.makecode.com/t/inventory-extension/8662/50 "2023-07-24T23:48:20Z")

</div>

This doesn’t seem that hard to add in, but I don’t have the time for this ☹ You can fork my extension and/or submit a PR if you wish!

---

<div class="post-metadata">

**Author:** ![jnegative](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jnegative/32/10173_2.png) [@jnegative](https://forum.makecode.com/u/jnegative)\
**Post date:** [July 25, 2023, 4:54pm UTC](https://forum.makecode.com/t/inventory-extension/8662/51 "2023-07-25T16:54:19Z")

</div>

Alright, that’s okay!

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [April 5, 2024, 4:40pm UTC](https://forum.makecode.com/t/inventory-extension/8662/52 "2024-04-05T16:40:14Z")

</div>

@UnsignedArduino can the Hotbar sprite be scaled smaller

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [April 5, 2024, 8:22pm UTC](https://forum.makecode.com/t/inventory-extension/8662/53 "2024-04-05T20:22:43Z")

</div>

Using the scaling attribute it’ll probably work. Never tried though.

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [April 7, 2024, 11:02pm UTC](https://forum.makecode.com/t/inventory-extension/8662/54 "2024-04-07T23:02:02Z")

</div>

It doesn’t look like it works with sprite scaling in sprites or with the scaling extension, if you know any other way I’d appreciate the memo, thanks!

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [April 8, 2024, 3:46am UTC](https://forum.makecode.com/t/inventory-extension/8662/55 "2024-04-08T03:46:37Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/027475756662299f48b59651df1f3e1da5ea69ac.png)  
Seems to work just fine for me. For example, I modified my last example code for this extension to make the toolbar half as big.

> **[Inventory example](https://arcade.makecode.com/36386-20767-82161-78368)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [April 8, 2024, 8:14pm UTC](https://forum.makecode.com/t/inventory-extension/8662/56 "2024-04-08T20:14:25Z")

</div>

Thanks I’ve been doing whole numbers, so that makes sense why it wasn’t working

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [April 9, 2024, 12:07am UTC](https://forum.makecode.com/t/inventory-extension/8662/57 "2024-04-09T00:07:21Z")

</div>

but it’s still not working

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [April 9, 2024, 12:08am UTC](https://forum.makecode.com/t/inventory-extension/8662/58 "2024-04-09T00:08:51Z")

</div>

I forgot to explain my situation I’m trying to use the scaling with the sprite utils on “screen z” block

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [April 9, 2024, 6:16pm UTC](https://forum.makecode.com/t/inventory-extension/8662/60 "2024-04-09T18:16:21Z")

</div>

Can you send your code?

I’m unsure why you would need the draw on z index block, as it’s already a sprite. Are you making it relative to camera?

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [April 10, 2024, 4:18pm UTC](https://forum.makecode.com/t/inventory-extension/8662/61 "2024-04-10T16:18:24Z")

</div>

I am making a Battle Royal game with the split-screen extension but, if I had the inventory set to camera, which I don’t have, it would show duplicate the inventory four times in the four screens, but it wouldn’t move with the one sprite it was supposed to be attached to. So, I used the on Z-index but it draws the image without being able to scale the drawn image down.

Here’s the game:

> **[Sprite Fight](https://arcade.makecode.com/S25174-91168-42871-38206)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

there is a lot of code though, so there’s a big mess, sorry.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [April 10, 2024, 7:50pm UTC](https://forum.makecode.com/t/inventory-extension/8662/62 "2024-04-10T19:50:01Z")

</div>

Hmmm…you may need to manually position the toolbar sprites every frame. (so a fake implementation of relative to camera)

Then you can use the scaling attribute to make it smaller.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/714ec67925b2367ede79bc3aabb70c11047209eb.png)

> **[Sprite Fight](https://arcade.makecode.com/34461-90809-46110-72501)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [April 10, 2024, 9:48pm UTC](https://forum.makecode.com/t/inventory-extension/8662/63 "2024-04-10T21:48:30Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![CodingGrizzlyBear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codinggrizzlybear/32/14838_2.png) [@CodingGrizzlyBear](https://forum.makecode.com/u/CodingGrizzlyBear)\
**Post date:** [May 12, 2024, 9:50pm UTC](https://forum.makecode.com/t/inventory-extension/8662/64 "2024-05-12T21:50:42Z")

</div>

Ho do I get an array of all the inventories?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [May 13, 2024, 2:04am UTC](https://forum.makecode.com/t/inventory-extension/8662/65 "2024-05-13T02:04:54Z")

</div>

Why do you need to do this? Typically you just need to keep it assigned to the player

---

<div class="post-metadata">

**Author:** ![User7](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/user7/32/16035_2.png) [@User7](https://forum.makecode.com/u/User7)\
**Post date:** [July 1, 2024, 9:04pm UTC](https://forum.makecode.com/t/inventory-extension/8662/66 "2024-07-01T21:04:40Z")

</div>

I tried to change the amount of items you can have in your hot bar to be one and change the amount of items in your inventory to 30 and it stopped working is there a solution to this? [https://arcade.makecode.com/S38308-86097-72373-28412](https://arcade.makecode.com/S38308-86097-72373-28412)

[Previous page](https://forum.makecode.com/t/inventory-extension/8662.md?page=2)

[Next page](https://forum.makecode.com/t/inventory-extension/8662.md?page=4)
