carenalgas / popochiu

Godot plugin to make point-and-click adventure games, inspired by tools like Adventure Game Studio and PowerQuest.
https://carenalgas.github.io/popochiu/
MIT License
189 stars 19 forks source link

What's the go to way to scale inventory items? #252

Open XaverStiensmeier opened 2 months ago

XaverStiensmeier commented 2 months ago

Bug description

I feel like this is a me problem and a question, but I am unsure where to ask. I struggle with resizing the texture of the inventory item to make it fit nicely into the inventory box and then resize it again when being dragged into the world.

For a small example scene, I have placed a prop in a scene. I have scaled it using Scale Mode in the main scene. When I add it to the inventory, as long as I have "Keep Size" "Fit Height" selected in the inventory_item scene, the image scales to its regular size and is way too large: grafik

I can fix that by switching "Expand Mode" to "Fit Height". But then again when I click the item in the inventory, I get the image in its full size again. I guess that's happening, because I scaled the prop in the main scene - not in the prop's scene. However, I cannot scale it in the prop scene because the texture is assigned in the main scene and therefore not known in the prop's scene. I could change that and assign the texture in the prop scene, but that's not what's done in the tutorial: https://www.youtube.com/watch?v=_an0YF3Bd50

grafik

Steps to reproduce

  1. Create an inventory item with a large texture.
  2. Add that item to your inventory.
  3. Click it in your inventory.

Expected vs observed behavior

Imho it would be best if inventory items get automatically scaled to a certain max width/height in order to have it nice and tight. I would expect a scale option for the prop's texture somewhere to allow using it from your inventory.

Environment information (please complete):

Again, probably that's just me. I am relatively new to Godot and I might be misunderstanding things.

mapedorr commented 2 months ago

We'll need to discuss this with the development team, but the idea of defining a maximum size could be a first solution.

On the other hand, the scale of the Prop in the scene shouldn't affect the Inventory Item because they are two different things.

XaverStiensmeier commented 2 months ago

We'll need to discuss this with the development team, but the idea of defining a maximum size could be a first solution. Sounds great!

On the other hand, the scale of the Prop in the scene shouldn't affect the Inventory Item because they are two different things.

Yes, but my question was more: Is rescaling the prop and the inventory item scene the right way to go? I feel like it's a bit counter intuitive that you rescale in another scene because then you need to change the scene to see if the proportions fit. Does that make sense? I have tried rescaling the prop by adding the texture directly in the prop instead of the scene, but that didn't work. When I drag the prob from the inventory, the icon is big again (as seen in picture 2)

mapedorr commented 2 months ago

You should scale Props inside the room they belong to. For Inventory Items there is no other option than scaling the item itself.

image Here, for example, I scaled the ToyCar prop and it worked.

Now, based on your description, I'm wondering if you tried to add the Inventory Item directly into the room in order to achieve something.

Would you mind recording a short video showing the process you are performing?

XaverStiensmeier commented 2 months ago

https://github.com/user-attachments/assets/8b17f534-9f9d-406d-834d-f07cc20a9527

Here you go. I guess, I am just terrible at explaining my issue. My main problem is that I do not understand what defines the size of the inventory item and the inventory item when clicked.

XaverStiensmeier commented 1 month ago

Did the video help or is it missing important parts that you need to see in order to understand what's going wrong?

mapedorr commented 1 month ago

Sorry @XaverStiensmeier . We completely forgot about this with all the things that were going on. We're actually working on giving the last touches to the GUIs before the release, so I'll take time to look at this issue right now. The video was pretty helpful! Thanks for recording it with your explanation of what's happening.

And once again, I apologize for forgetting to check this issue.

mapedorr commented 1 month ago

@XaverStiensmeier I made a test in Popochiu 2 beta 3 and got to reproduce the issue, but there is already a fix in the develop branch for this. Here is a video that shows how a big item is rendered in this branch.

https://github.com/user-attachments/assets/3524f7c3-a4c2-4abf-90a1-b73987a1ebce

Maybe you can change the Expand Mode to Keep Size and Stretch Mode to Keep Aspect Centered in order to test if that fix the issue en Beta 3. Otherwise, I'll ask you to wait until we release 2.0, or to update your project to use the version in the develop branch.

XaverStiensmeier commented 4 weeks ago

Sadly, using Keep Size and Keep Aspect Centered on the inventory_item_potion did not work for me in the 2.0 beta release. That's already what I've used before (as you can see in my video).

Mhm, I just tried using the develop branch on a new project in order to avoid any "upgrade issues", but after reloading and selecting the template "Simple Click" and pressing OK, it hangs on "Copying a bunch of components 10%".

EDIT: I will soon retry with the newly pushed version.

mapedorr commented 6 days ago

Hi @XaverStiensmeier . Did you manage to try this again? We're just double checking if we can close the issue or if there's still something we have to fix or improve.

XaverStiensmeier commented 1 day ago

Hi @mapedorr I am currently out of town and do not have access to godot atm. I will get back to you once I was able to test it.