Game
Demon Detective
4 years ago

A short article about some UI stuff and wishing I had more time to work on the game :|


Hello there!

This week has seen me dive back into UI and get to work on the suspect Testimonies screen. This involves setting up a left-hand panel with the suspect photo, and simple bio, and a right-hand panel with their testimonies on the various lines of inquiry. Like this:

journaltesties002.png

The left-hand panel was easy enough to set up, but the right-hand one is going to be a bugger, because it needs to scroll. Which is fine - I have set it to be a scroll view, and after some fiddling with the settings I got it working as intended. However, I need it to be dynamic, which means creating a specific PlayMaker FSM to count the number of 'headers' and pieces of info, add up the height of each, and if the total is more than 950px, enable the scroll bar and set the scroll view content height to be taller. 

I had naively thought that fairly standard functionality like this would be built-in to the scroll view, but no. So, it's yet another piece of UI code I'm having to make. 

And the 'dynamic' part has also proven to be another challenge in terms of figuring out what info each suspect tells you about each line of inquiry and making the relevant text line appear in the right place. I was originally going to create unique UI objects for each and assign the relevant text string directly (same as the Evidence screen), but after having the random thought "Hang on, can you make a prefab out of UI elements?" and discovering that you definitely can, I now create a new object from the prefab at runtime and assign the required string to it. So that was something cool to figure out.

The only thing I wish for is more and longer chunks of time to work on the game. The solution I came up with above, through experimentation, I wouldn't have been able to come up with if I hadn't had about 4 hours to myself one night. When you only have a snatched hour here and there, you just have to go in charging, full-on stream of consciousness work, as you tick off your to-do list of Trello tasks before the timer runs out. This does not offer you any time to sit back and properly ruminate on a problem and think of unique solutions. Instead, you land on the first solution that comes to you and grimly work your way through it, with little regard as to whether it's actually optimal.

But enough of my first-world problems! I've made good progress, and I'm part way through the whole dynamic scrolling setup, so I hope to finish that off this coming week.

Tony.



0 comments

Loading...

Next up

My last few months of work...

August #gamedev update 01 - in-game UI setup!

#indiegame #unity3d

Well hello!

This is the first devlog for Demon Detective, and I'll be doing a (usually) weekly article to let you know about my progress.

But for now "Hi!" and I'll see you around :)

Just roughly blocking out the start area of the game as a test piece for both the level design and game design parts of the process.

This is the first room, with three ways forward. Now, why would that be... hmm :)

DUNGEON PATHS September updates! #gamedev #indiegamedev #unity3d

Just started on some quick lighting tests - first image is unlit for reference

Did you know that today is #InternationalJazzDay? 🎷😎

No? 😯 Well, we couldn't pass up this date!

And what better to celebrate this day than #Pecaminosa #OST? 🎷

Let us know what you think about it and have a great weekend!

We are under attack!

Heya there! I really wanted to show you all a little gameplay preview of the first boss fight i'm currently working on i hope you like it ^^