Hey y'all! Sorry we've been so quiet, we've been so busy as we've both returned back to "real" work
Not much progress gameplay wise, but the prototype is nearing completion.
We've taken some time to explore some UI options. We found a style we like and I spent some time putting together some tools to help as achieve the look we want.
The style has a lot of rounded cornered panels with drop shadows and outlines. We wanted it to be easy to put together in the editor, and run well on even low end devices. We also want to create a UI that scales correctly to match your devices native UI. This means physically consistent UI sizes regardless of screen resolution and size, and it means coming up styling rules for text/padding so that everything roughly matches what you would see in the devices native UI.
Here is a mock-up scene with our UI:
Our UI contains no images. The above was composed using our RoundedRect UI script, SVG UI icon script, and unitys build in Shadow and Outline UI effects. Because everything is mesh, everything stays nice and crisp at any resolution without needing huge UI textures.
Here is a picture showing the physically consistent sizing across 2 devices:
A breakdown of all the goodies that went into making this:
RoundedRect (Graphic)The rounded rectangle script implements unitys MaskableGraphic class, and generated the rounded rectangle to fit the RectTransform. This means it "just works" with the UI system. (Masking, tinting, click detection, layout placement etc). And because there is no custom material or shader required to render the rounded rectangle, unity is able to batch the rounded rectangles together (regardless of color, border radius and border pinch) which is awesome for performance.
Note the gifs bellow are using the built in UI "shadow" effect to generate the darker border at the bottom of the rect.
We can configure the radius:
And the pinch of the corner:
Pointer (Effect)An effect that can be attached to any UI graphic. It appends a triangle pointer to the graphic that points at another RectTransform. Again, using Unitys UI effect "pipeline". This means that I can apply a shadow effect to the object and the shadow is applied to the appended triangle pointer too. It "just works".
It has 2 modes, one that points exactly where the other rect is all around, and another mode that clamps the pointer to the sides of the rect.
Sheen (Effect)A sheen effect to play over UI graphics. Think coins, or flashy buttons. There are some pretty messy ways to achieve this effect... For example, you can treat the parent graphic as a mask, and add your sheen effect as a child to it. You can pan the child across to give it a sheen effect. But this is super messy and pretty expensive for a small effect. (You need 2 seperate graphics and a mask, all of this breaks batching too.). Our approach uses a custom shader to render the sheen, and all sheens using the same texture are batched together. Sheen properties (like Width, Pan Speed) are encoded into the second UV channel of the graphic, so it means you can have lots of sheen effects with lots of different properties, all without breaking batching. Kind of overkill, but it was fun to implement!
Here is the effect on a button.
This script also uses the appropriate UI pipeline for effects, so you can mix and match it with other effects. You can see that in the above gif (the shadow and outline of the button receives the sheen correctly). In the gif bellow, I've mixed the pointer effect with the sheen effect.
We can even repurpose the sheen for other cool effects, like this loading bar!
SVG UI Mesh (Graphic)This script lets us plug in SVG files and treat them as regular UI images. Crisp icons, low file/memory footprint!
Here is a cog SVG adhering to its RectTransform.
Again, since we are using the proper UI pipeline, it means that our icons react correctly in layouts, for example:
Hopefully more gameplay related updates soon.