Added textures for Blocks

This commit is contained in:
Simon Lübeß
2021-03-24 14:44:02 +01:00
parent 1b00fa67a5
commit 5873f12643
10 changed files with 269 additions and 31 deletions
+28
View File
@@ -0,0 +1,28 @@
using System;
using GlitchyEngine.Math;
namespace Sandbox.VoxelFun
{
class BlockTexture
{
private String _fileName;
public String FileName => _fileName;
private Vector2 _atlasStart;
private Vector2 _atlasSize;
[AllowAppend]
public this(String fileName)
{
String str = append String(fileName);
_fileName = str;
}
public Vector2 TransformTexCoords(Vector2 texCoords)
{
return _atlasStart + texCoords * _atlasSize;
}
}
}