filmov
tv
Drawing Your Inventory to Screen (GameMaker Studio 2 Tutorial)

Показать описание
This video is part of our GameMaker Studio 2 Inventory tutorial series! Today we're talking about how to draw our inventory to the screen, which is necessary for building a UI to interact with the inventory.
In the first video I explained what inventory is conceptually (basically just an item identifier and a count of how many of those items you have), and then showed how to implement it in GML code. We ended up pairing object indexes with counts in a ds_map (one of GameMaker's built-in data structures).
In this one, we add on to that a little bit by adding a ds_list to track unique object indexes in our inventory, for the purpose of iterating through our inventory efficiently to draw it. We also add simple toggling functionality to control whether we draw the inventory to screen or not.
Using these simple techniques, you have the foundation you need to make your inventory look however you'd like, whether that be toggling a separate screen like Pokemon or Skyrim, or having a bar across the bottom of your screen like Minecraft!
As always, thank you guys for watching! Please post any questions you have in the comments below!
Music:
Thoughts - Eric Godlow
In the first video I explained what inventory is conceptually (basically just an item identifier and a count of how many of those items you have), and then showed how to implement it in GML code. We ended up pairing object indexes with counts in a ds_map (one of GameMaker's built-in data structures).
In this one, we add on to that a little bit by adding a ds_list to track unique object indexes in our inventory, for the purpose of iterating through our inventory efficiently to draw it. We also add simple toggling functionality to control whether we draw the inventory to screen or not.
Using these simple techniques, you have the foundation you need to make your inventory look however you'd like, whether that be toggling a separate screen like Pokemon or Skyrim, or having a bar across the bottom of your screen like Minecraft!
As always, thank you guys for watching! Please post any questions you have in the comments below!
Music:
Thoughts - Eric Godlow
Комментарии