Displaying an Avatar
Wednesday, January 10, 2018Most people that use my Steamworks library only want to do a few basic things. One of those is showing an avatar.
Easy WayThe simple answer is:
- Grab this component.
- Put it on a RawImage.
Manual WayThe manual way is basically just looking at the above component and seeing what it does.
Request The Avatar
What's in the Image
- Width + Height- size of the image in pixels
- Id - Steam's internal image id (not Steam Id)
- Data - array of bytes, 0-255 representing the colours.
- GetPixel( x, y ) - convenience function, lets you get the Color of a pixel at x, y
DataYou can manually read from Data if the convenience class is too dumb for you and you want to do something smarter. The data is laid out RGBA. Here's how GetPixel reads a pixel.
Turn your phone to view blog list