UI buttons for game - Paid Help

Godot Version

4.5

Question

I have a platform game and most levels scroll left and right. Think its 3 that are vertical.

I need some help on adding movement buttons - left and right, plus, jump and fire. I’ve built 3 or 4 rows into the bottom of each level so that the buttons can be in the same place and out of the way of the player / enemies etc.

Anyone able to help ?

What’s your exact problem?

1 Like

Hi

Thanks for the reply

The problem is that i cant find a way to make the controls auto adjust at the bottom of every level like the “Verticalbox container”

Did you try with VBoxContainer?

I’m not the main coder, as Godot is fairly new to me. I design the graphics and the levels.

I’m trying to help my mate as he’s struggling on this and is currently away on holiday. However, the issue is holding me up.

If you see the project - would that help ?

If easier pls email me to discuss it and payment

PLPETERS

At

Thanks

You haven’t given much to go off of. Maybe it would be better if your partner posted to the forum

1 Like

Please let me know what info you need and I will share it. Thanks.

Show a screenshot of the UI scene tree and how it currently looks like in the 2D viewport + ideally a mockup version of how you’d want it to look like.

1 Like

Hi

The VBoxContainer won’t work because the tilemap layer is a Node2d and not a Control node type.

I’ve attached images of the UI

I’d like the buttons to be near the bottom of the screen on all levels. Not all the levels are the same height.

This version of the level shows 2 black lines at the bottom of the level. I will add real tiles instead of these black lines so it looks better and want the buttons near the bottom.

Thanks

Ah yes, the TouchScreenButton node. They are hard to work with not being a Control node, I’ve wrapped them in a Control node with a similar “Custom Minimum Size” set. When playing on mobile (specifically from the web) the icons would shrink for me, so I also made them much larger assuming they would take about half the size on-target.

1 Like

Thanks.

Any suggested layout of the code please ?

I didn’t add any code for this to work.

The game plays on the mobile so I need to know how to ensure the buttons stay on the same place for each level.

How do I implement VBoxContIner ?

Thanks

You probably want a HBoxContainer, it’s a Node so you can add it to your scene like any other. Then add a Control node as a child of that, set it’s Custom Minimum Size and re-parent your TouchScreenButton to the sized Control.

Thanks. Will this mean the buttons are in the same place on each level ?

They should be in the same place on the screen, unrelated to the level. Maybe you want to add the TouchControls as a global so it appears everywhere, or create a base level to inherit from each level with the touch controls.

Ok. I’ll have a look. If I need help can I send you the project and pay you to add the UI ?