Posts

Showing posts with the label Progressbar

c# code to generate a custom texture

Image
Previous post: How to make circular progress bar(2nd) How to make circular progress bar Let's see how to generate a custom texture. Added : If you know python consider this. https://gameenginebread.blogspot.com/2017/12/texture-generator-python-per-pixel-c.html Step 1. Create C# Project. Step 2.  This form1 class code that create a new BMP with PerPixelAction function. using System ; using System.Collections.Generic ; using System.ComponentModel ; using System.Data ; using System.Drawing ; using System.Linq ; using System.Text ; using System.Threading.Tasks ; using System.Windows.Forms ; namespace TexGenTest { public partial class Form1 : Form { public static double DegToRad = 0.0174533 ; public delegate Color PerPixelAction ( int x, int y, Size ImageSize, Bitmap BitmapData, double Para1, double Para2, double Para3 ); public Size MidSize = new Size( 128 , 128 ); public Form1 () { ...

How to Make Circular Progress Bar(2nd)

Image
Previous post : How to Make Circular Progress Bar In this time, decorate the material blueprint. Step 1.  Render pixels on unfilled area. Modify existing material. Step 2. Limited range. Unfortunately, This is not working with rounded tip textures. Step 3. Flip sample texture. More... We know current fill rate and value per pixel. So we know pixels about the top(highlight tip) or pixels to skip rendering(Grid). It is not a common use, I will skip that example.

How to Make Circular Progress Bar(or Rounded Rectangle)

Image
How to Make Circular Progress Bar? Step 0. Circular bar is cool to look, but find angle(or percentage) per pixel in runtime is costly. Especially rounded tip(or rectangle) is worse. So, we need...  - Texture that has angle per pixel from center.  - The value must have sufficient resolution. 2 byte(1/65536) will be OK.  - Must support various shapes. Step 1. Prepare angle lookup-texture and diffuse texture. Prepare angle lookup-texture and diffuse texture. These are that textures that I made. I'll let you know in another post how I made that textures with C#. Step 2. Import Textures. To keep original value, change lookup texture properties just like a screen shot below. Step 3. Material This is a material that work with the lookup textures. It is Unreal Engine 4 material but you can make it Unity version easily. In most cases, this is sufficient, the improved version will...