Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Cool. Ok, I am assuming you are referring to the buttons in the first preview (the “Main Menu” one), right?

For this, you can use the following two files:

  • Buttons/Blue/ButtonDigital_Highlighted.png
  • Buttons/Blue/ButtonDigital_Press.png

The second one is an animation and you can slice it into 4 multiple sprites and create three animations for your single button:

  1. Unpressed - In this case, it is just an empty animation with no sprite.
  2. Press - This animation will be all 4 frames, at a relatively fast frame rate that plays once and doesn’t loop
  3. Pressed - This is the state that it goes to after you play the “Press” animation, and it is basically the 4th frame or the Highlighted.png file mentioned in the previous step.

You can then create a button component that uses the sprites as the background and the text over it. Note that in the example, by default the text is blue, but during the Press animation, because the button background changes to blue, the text changes to black. This can also be done in the animator as a separate keyframe.

Then, in Unity, you play the animation based on whether a mouse is over or pressed and play the Press animation into the Pressed animation.

I hope this is detailed enough to be useful. Let me know if this makes sense or if I can help in any other way.

Yes, thank you, it does make sense to me. I was able to nine-slice the ButtonDigital_Press image and put it all in the button, but still having issues displaying the button and other UI properly. I would definitely prefer a visual showcase of what to do since I'm a visual learner. Thank you and I don't mean to be a bother if I am, I really appreciate the work you are doing and your work has been inspirational for my own asset development.

And also added the animator and CS code :)

Awesome. Okay I’ll make a visual guide this week. And it’s not a bother at all, happy to improve wherever I can and help in any way I can.

Hi, I just wanted to give you an update on this. Sorry for it taking so much longer than I had planned - but am making a full demo for it in Unity as well. I am nearly done and should have it completed in the next couple days.

Hi, no worries at all! I am in literally no rush, I just really like your work and wanted to implement your graphics and such in my own game since I am not nearly as experienced in pixel art. I look forward to your demo!

Sorry I didn’t reply to your previous message, I don’t know how I missed it haha. I wanted to let you know I finished creating the demo and hope it helps to show how you can use the elements. It also has prefabs for all elements, code for some systems and more. More information here: https://deadrevolver.itch.io/pixel-ui-hud-pack/devlog/902472/new-unity-demo

Thanks for your patience while I built this. I hope it helps.